Jump to content

DOM: problem with access of an iframe's content


Adry1

Recommended Posts

Why do I get the whole document's content instead of an iframe content?I try to work with an iframe object within my document through DOM interfaces.To obtain an iframe, I use the following approach:

curWindow.Document.all.item( frameName )

where "curWindow" is an active document, which contains IFRAME, and "frameName" is the iframe's id. I get an object, which looks like the needed IFRAME (I am able to access its properties like id or src - all is fine). But I can't access the frame's content! I get the content of the whole document instead :)IFRAME is described in the parent document like the following:

<iframe src="ViewOverFillAction.do?method=overFillSearch" width="100%" height="300" frameborder="0" scrolling="no" id="overfillFrame"></iframe>

I try to access the frame's content in a following way:

Frame.Document.documentElement.outerHTML.value

where "Frame" is an object which I get for the needed IFRAME

Link to comment
Share on other sites

if you get Frame by using document.getELementById then you end up with the current documents content. I assume this is a bug.This will get you the content of the iframe document.

document.frames['frameName'].document.body.innerHTML

Link to comment
Share on other sites

if you get Frame by using document.getELementById then you end up with the current documents content. I assume this is a bug.This will get you the content of the iframe document.
document.frames['frameName'].document.body.innerHTML

As I have written, I use all collection to obtain a frame.And I've tried you suggestion - it does not help...
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...