Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Executing a javascript that's in an HTML currently in a webbrowser

Status
Not open for further replies.

MuadDubby

Programmer
Sep 23, 1999
236
0
0
CA
Hi

Longish title, but explanatory (I hope).

I've got a webbrowser control on my form, and I've navigated to a page that contains some javascripts on it. How do I execute one of those scripts and pass it the parameters it expects?

I put a watch on the webbrowser and found that there's a webbrowser1.document.scripts node, but under that I got a little lost. I couldn't find a node underneath that that contained the script I'm looking for (I do know the name).

Am I looking in the right place? If so, can someone give me an idea of how to execute the script?

Thx in advance,
.DaviD.
 
i couldn't say without loading it up and checking it out, not at home at the moment, is the scripts node an array of the scripts on the page perhaps?
 
yup, the scripts end up as an array under the webbrowser control.

I have webbrowser1.document.scripts, and under that, there's an instance for each one of the scripts. I got that far. But after that, it gets a bit messy. Under each one of the script occurences you'd assume there's a property that holds the script's name; I found none.

I also need to find out the method used to execute the script, and how to supply it with parameters.

I'll try and actually submit some code tomorrow. That'll probably make it easier for you to follow.

Thx,
.DaviD.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top