Basically the title says it all, I need to add javascript to webBrowser1 that is called when a button is pressed. This java I want to call is not in the page itself, which therefore is my dillema. How do you add javascript to the page on button press, without changing the source code to the page that you are on? is it a matter of copying the code and going to a page "about:
", or there some other way to do this? Thanks for your time
ChongoPosted Dec 9, 2007, 12:55 AM
You can also grab individual elements by name or id if you set the name/id in the html tags:
HTMLDocument doc = webbrowser.Document as HTMLDocument;
IHTMLElement webElm = doc.getElementById("elementidhere-or-nameifgetbyname");
//used to read form values etc
elementfromabove = webElm.getAttribute("value", 0).ToString();
abdelgaderPosted Dec 8, 2007, 12:15 PM
Hi,
you can see in : http://dotnetslackers.com/articles/aspnet/JavaScript_with_ASP_NET_2_0_Pages_Part1.aspx
AlexPosted Dec 8, 2007, 10:43 AM
ChongoPosted Dec 8, 2007, 10:01 AM