Thank you very much for the reply Peter. Please see comments below.
On Jun 15, 1:42 pm, Peter Michaux <petermich...@gmail.comwrote:
On Jun 15, 7:44 am, "DRS.Use...@sengsational.com"
<DRS.Use...@sengsational.comwrote:
When I run
[code]
alert("page contents:" + content.document.documentElement.innerHTML);
I didn't know "content" would access the window object. I think it is
far more standard to write window.document....
I could have been more descriptive. In my case, "window.document..."
doesn't work, and "content.document..." does (at least for the page
with the frameset). The likely wild card: I am running from an
overlay in a Firefox extension.
I am able to pull the content. I see something like this
-
page contents:<head><title>A Title</title>
-
<FRAMESET ROWS="75,*">
-
<FRAME SRC="sample2.html" NAME="nav" title="Main Navigation">
-
<FRAME SRC="sample.html" NAME="body" title="Main Content">
-
</FRAMESET>
-
What I want to get is the HTML inside of one of the frames,
specifically "sample.html".
window.body.documentElement.innerHTML
where "body" is the NAME attribute of the frame. Probably better to
choose a different name since "body" has special meaning in a
document.
The page, at the moment, is authored by me, and I can change "body" to
anything, but once this code gets into doing real work, it will be
somebody else's page, so if they choose "body", I'll need to deal with
it.
So here's what I see so far:
content.document.documentElement.innerHTML shows the page contents
(the page with the frameset).
Based on your suggestion to use "window" instead of "content", I tried
this, which should work, but doesn't:
window.document.documentElement.innerHTML says "undefined".
content.body.documentElement.innerHTML gives a TypeError: content.body
has no properties.
I renamed "body" to see if it made any difference...
content.dale.documentElement.innerHTML says content.dale has no
properties
window.dale.documentElement.innerHTML says window.dale has no
properties
Any more ideas for me?
--Dale--