GeorgeU
GeorgeU

Reputation: 8669

How to get the return value of a JavaScript function/Object on Webbrowser Control

How can i can get/capture the value of a JavaScript object on the page rendered in a webbrowser control, or alternatively capture the return value of a function?

The only example I saw is the following in delphi. Looking for a better solution in C#

http://www.delphidabbler.com/articles?article=21

Upvotes: 0

Views: 2866

Answers (2)

Novikov
Novikov

Reputation: 4489

You need the InvokeScript call of HtmlDocument. MSDN documentation on ObjectForScripting

Upvotes: 2

Daniel T.
Daniel T.

Reputation: 38390

One piece of info missing is what you want to capture it to. I personally use Firefox with Firebug. It allows you to use the Javascript command console.log(object); to log an object to the Firebug console. Same applies for function return values, console.log(myFunc());.

Upvotes: 0

Related Questions