Question How can I execute a javascript function that is on a web page ?

smiley_mick

New member
Joined
Mar 22, 2011
Messages
2
Programming Experience
Beginner
What I am trying to do is go to a website using a webbrowser, and then simulate a click. I can do this easy enough when the click is on a regular button, not handling javascript. But it seems that the website has a javascript function handling the click that I want to simulate:

VB.NET:
<script language='JavaScript' type='text/javascript'><!-- function setgotopageNR() { if (document.gotopageform.gotopage_reverse.value=='1') { document.gotopageform.page.value=8+1-document.gotopageform.gotopage.value; } else { document.gotopageform.page.value=document.gotopageform.gotopage.value; } } //--></script>[/HTML]

I have tried various solutions found through googling, such as WebBrowser1.Document.InvokeScript, also opening the website in internet explorer and then converting its document to IHTMLDocument2 and getting its parent window as IHTMLWindow2 and then using execScript.

Any ideas?
 
Back
Top