Hi everyone
I have a JavaScript app that creates an IFRAME through DOM
(createElement( 'IFRAME')) However, that IFRAME does not have any content
yet.
alert(iframe.co ntentWindow.doc ument.documentE lement)
gives null.
How can I, through DOM, create the root element? I can't find it.
My following question: In that IFRAME I need to load a stylesheet.
However, I can't seem to get the LINK in IFRAME thing working. I tried,
but IE 6 just seems to ignore the stylesheet speicified in the LINK. I
have the following code, in which win is the window of the IFRAME
(iframe.content Window).
eLink = win.document.cr eateElement("LI NK");
eLink.setAttrib ute("REL","styl esheet");
eLink.setAttrib ute("HREF", GUIstyleSheet);
eLink.setAttrib ute("TYPE","tex t/css");
win.document.do cumentElement.a ppendChild(eLin k);
But this:
win.document.op en();
win.document.wr iteln("<HTML><H EAD>");
win.document.wr iteln("<LINK REL=\"styleshee t\"
HREF=\""+GUIsty leSheet+"\" TYPE=\"text/css\">");
win.document.wr iteln("</HEAD><BODY></BODY></HTML>");
win.document.cl ose();
does work? Does anyone know why? Or what I am doing wrong?
Thanks!
Vincent
							
						
					I have a JavaScript app that creates an IFRAME through DOM
(createElement( 'IFRAME')) However, that IFRAME does not have any content
yet.
alert(iframe.co ntentWindow.doc ument.documentE lement)
gives null.
How can I, through DOM, create the root element? I can't find it.
My following question: In that IFRAME I need to load a stylesheet.
However, I can't seem to get the LINK in IFRAME thing working. I tried,
but IE 6 just seems to ignore the stylesheet speicified in the LINK. I
have the following code, in which win is the window of the IFRAME
(iframe.content Window).
eLink = win.document.cr eateElement("LI NK");
eLink.setAttrib ute("REL","styl esheet");
eLink.setAttrib ute("HREF", GUIstyleSheet);
eLink.setAttrib ute("TYPE","tex t/css");
win.document.do cumentElement.a ppendChild(eLin k);
But this:
win.document.op en();
win.document.wr iteln("<HTML><H EAD>");
win.document.wr iteln("<LINK REL=\"styleshee t\"
HREF=\""+GUIsty leSheet+"\" TYPE=\"text/css\">");
win.document.wr iteln("</HEAD><BODY></BODY></HTML>");
win.document.cl ose();
does work? Does anyone know why? Or what I am doing wrong?
Thanks!
Vincent
 
	
Comment