[thelist] appendChild() invalid for frame?

Peter-Paul Koch gassinaumasis at hotmail.com
Thu Jun 19 09:50:22 CDT 2003


> > > var idoc = document.getElementById('theFrame').contentWindow.document;
> > > idoc.body.appendChild(newNodes);
> >
> > Youre accessing the iframe incorrectly. Try frames[theFrame].document
> > instead. See http://www.xs4all.nl/~ppk/js/index.html?iframe.html for 
>more
> > information.
> >
> > Of course it could always be that IE doesnt allow you to append children 
>to
> > an iframe at all. I dont know, I never tried it.
> >
>
>thanks, I hadn't thought of that - but it gives the same result. I did try
>setting the src of the iframe (since the spec requires it after all) and
>appending to that. Also tried using createTextNode() to make a simple node
>instead of cloneNode(). Also tried making a 'regular' frameset page and
>copying a node from frame1 to frame2. Apparently IE just won't let you
>manipulate the DOM between frames. I can't see any good reason for this
>except a bug or an overzealous security model (imagine that!)

OK. New fact.

>as usual with these things, it is highly frustrating to the humble web
>developer. Does anyone know a way to dynamically assign a chunk of HTML to 
>an
>IFRAME (can't use src or document.location because there is no such thing 
>in
>this case)?

What you could try is putting the functions themselves in the page in the 
iframe and call them from the main page. Sometimes this helps

-------------------------------------------------------------------
ppk, freelance web developer
Interactie, copywriting, JavaScript, integration
http://www.xs4all.nl/~ppk/
Column "Keep it Simple": http://www.digital-web.com/columns/keepitsimple/
New: Forms, usability and the W3C DOM:
http://digital-web.com/features/feature_2003-05b.shtml
------------------------------------------------------------------

_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail



More information about the thelist mailing list