iframe reading problems

Giganews Newsgroups
Subject: iframe reading problems
Posted by:  Jeff Thies (cyberje…@sprintmail.com)
Date: Mon, 07 Jul 2003

I'm (still) having trouble reading the contents of an IFRAME (IE5).

  I have this:
var my_iframe = document.frames['my_iframe'];

What I would want to do at that point is get either the
contentWindow.document or the contentDocument depending on whether this
was IE or Mozilla. (Thanks Lasse.)

  I'm not finding this.

if I iterate through the properties:

var c='';
for (var prop in my_iframe){
c+='property:'+prop+"
";
for(var item2 in my_frame.prop){
c+=' item2 '+item2;
}
}
alert(c);

  I don't see the needed properties and none of the properties I do see
have any properties themselves.

Here are the properties I do see:

clientInformation,clipboardData,closed,defaultStatus,document,event
,external,frames,history,Image,length,location,name,navigator
,offscreenBuffering,onafterprint,onbeforeprint,onbeforeunload,onblur
,onerror,onfocus,onhelp,onload,onresize,onscroll,onunload,opener,Option
,parent,screen,screenLeft,screenTop,self,status,top,window

Is this an IE5.0 limitation (I use the "least common denominator"
browsers to test, and you can't load two IE versions on windows)?

Or have I done something else wrong?

  Jeff

Replies