Get Javascript Generated HTML from WebBrowser
I'm loading HTML into the web browser control, and adding a bit of javascript that hightlights a section of html when the user clicks on the area, by changing the classname. If you know the FireBug addin for Firefox, it's very similar to that. But what I need to do after this, is take the HTML source, and find where they clicked. But when I get the DocumentText of the webbrowser control, it's the original source. Not the source with the added class name.
Is there a way to get the source code with the javascript generated html?
Thanks
Re: Get Javascript Generated HTML from WebBrowser
if you know exactly what the javascript does, can't you get the original html from your webbrowser, then apply the same changes?
Re: Get Javascript Generated HTML from WebBrowser
The javascript adds a class to a dom element that the user clicks on. So the javascript doesn't do anything until there is user interaction.
Re: Get Javascript Generated HTML from WebBrowser
Well I came up with a way. I'm not sure if it's the best way. But it works.
I modified the js to raise an event that the .net form processes. The js passes in the html source, which is the must up-to-date with the changes made by the js. If anyone else has any other ideas, I would still like to hear them
Thanks
Re: Get Javascript Generated HTML from WebBrowser
You can ofcourse envoke the script, if you know what its called by using this method.
Code:
WebBrowser1.Document.InvokeScript(JavaScript)
Redmo
*Edit:Forget it, sorry, i totally misread what you posted.. *