|
-
Jun 27th, 2004, 01:42 PM
#1
Thread Starter
Addicted Member
execSript
I have a link for the msdn on the execScript but i cant seam to run it 
can some1 perhaps post a form with it working with a javascript function in a html doc on a webbrowser control or offer some advice.
Tnx in advance
Adz
-
Jun 27th, 2004, 02:17 PM
#2
Addicted Member
Suppose there is a Submit function that accepts 2 parameters in the third frame of a document. wb is the webbrowser object. The following code works fine for me.
VB Code:
wb.Document.frames(3).Document.parentWindow.execScript("Submit(" & myvar1 & "," & _
myvar2 & ")", "JavaScript")
If you still have problems send us your code!
Good luck!
-
Jun 27th, 2004, 02:56 PM
#3
Thread Starter
Addicted Member
firstly what is the frames bit, and secondly is that running two variables??
-
Jun 27th, 2004, 03:46 PM
#4
Thread Starter
Addicted Member
ok im really lost i have a basic javascript function of names Msg in the html doc that is in the webbrowser1
the html doc is pure basic, with no frames. im a bit lost i have no code coz all i got is a button (command1) and a webbrowser control (webbrowser1)
the form load has the navigation to the url and that is it. what do you put in command1 to run the msg function in the html doc
Thanks Adz
-
Jun 27th, 2004, 04:31 PM
#5
Fanatic Member
As little as this:
VB Code:
WebBrowser1.Document.parentWindow.execScript("Msg()")
Actually from JavaScript you would call the execScript function like this: window.execScript, but since the WebBrowser control doesn't have a Window property, you need to call Document.parentWindow to get a handle on the window object.
Author for Visual Basic Web Magazine
-
Jun 27th, 2004, 04:36 PM
#6
Thread Starter
Addicted Member
Ok great got the basics done im gonna do some Javascript research and ill be bac with another post to this for more Q. 
tnx All
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|