Adry1 Posted June 19, 2006 Share Posted June 19, 2006 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 More sharing options...
aspnetguy Posted June 19, 2006 Share Posted June 19, 2006 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 More sharing options...
Adry1 Posted June 20, 2006 Author Share Posted June 20, 2006 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 <{POST_SNAPBACK}> 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 More sharing options...
aspnetguy Posted June 20, 2006 Share Posted June 20, 2006 I would recommend against using document.all since it only works in IE. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now