Retrieving all JavaScript variables

J

julekmen

Hello,

I have a C# project, I use System.Windows.Forms.WebBrowser (mshtml
wrapper) to show a html page. I want to retrieve all Javascript
variables and their values.
Only thing I have found is: http://support.teamdev.com/docs/DOC-1062 -
but here are used some special Java wrappers.
Do you know, how to do it in System.Windows.Forms.WebBrowser?

Thanks!
 
D

Dick Grier

Hi,

I do not know if this is the only way, but here is what I do. I add a
JavaScript function for each variable that I want to return to my
application, and return it explicitly as an event argument (here named
ReturnVarZ in my application code):

function GetVarZ()

{

var z = SomeValue;

window.external.ReturnVarZ( z);

}

I hope this helps.

Dick
--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top