DOM innerHTML... similar to ASh on June16,2008
Matt <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.dom |
|---|---|
| Organization | http://groups.google.com |
| Message-ID | <124f6f1f-bf9d-4fbe-8420-881e410bd24d@e18g2000yqo.googlegroups.com> |
I am very new to this so you will have to forgive me. I call myself
searching developer.mozilla.org and not being able to find the answer
I am looking. Any help or pointers would be greatly appreciated.
Thanks in advance!
I am trying to extract the exact html contents on a web page. I have
discovered the innerHTML property and I am able to retrieve everything
between the <html> tags but not including the <html> tags. Also, I
have noticed that the string returned by innerHTML is not the same as
if you were to right click on the page and do a view source. Here is a
simple exercise I performed to prove this. I wrote a simple HTML page
like this:
<html>
<head></head>
<boDy>
<p>This is a test</p>
</body>
</html>
If you right click on the page and select view page source, you get
the same exact thing as above. If you write an enhancement to do this
within your xul on the page load event:
var fcontent = content.document.documentElement.innerHTML;
alert(fcontent);
You will recieve:
<head>
</head><body>
<p>This is a test</p>
</body>
Is there any way I can get the exact source of the html page? Is there
anyway to access the exact content you see when you do a view page
source?
Again, thanks for any help!
Matt