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
You need the InvokeScript call of HtmlDocument. MSDN documentation on ObjectForScripting
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());
.
精彩评论