|
-
May 26th, 2009, 02:16 PM
#1
Thread Starter
Frenzied Member
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
-
May 26th, 2009, 03:45 PM
#2
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?
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
May 26th, 2009, 04:11 PM
#3
Thread Starter
Frenzied Member
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.
-
May 26th, 2009, 05:32 PM
#4
Thread Starter
Frenzied Member
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
-
May 26th, 2009, 05:50 PM
#5
Addicted Member
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.. *
The universal aptitude for ineptitude makes any human accomplishment an incredible miracle -Col. John P. Stapp
Please rate the posts that have helped. Makes us feel all warm and fuzzy
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
|