开发者

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

开发者 https://www.devze.com 2023-02-11 07:12 出处:网络
开发者_如何学JAVAHow 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?
开发者_如何学JAVA

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());.

0

精彩评论

暂无评论...
验证码 换一张
取 消