Actually, I just discovered one of my STUPID errors (camelcase vs uppercase
on the HTML part of innerHTML) below and it turns out that
var fnTemp = new Function( "sValue", "window." + this._frameId +
".document.documentElement.innerHTML = sValue;" );
fnTemp( sValue );
does the trick.
Ugly, but it works. Anything more elegant, similar to
window.frames(sFrameName).document.documentElement.innerHtml = sValue;
??
Thanks
Tony
"Anthony Evans" <[EMAIL PROTECTED]> wrote in message news:...
> I'm trying to set the innerHTML property of an IFrame in NN 6.01.
>
> It only seems to work intermittently and never the way I want.
>
> Ideally, I would like to be able to:
>
> window.frames(sFrameName).document.documentElement.innerHtml = sValue;
>
> I come pretty close with the test script below, but never quite win the
> booby prize.
>
> I've been checking google, faqts, netscape, jstips and everything else
> referred to on these groups for the past two days and am completely
> frustrated. No one seems to be able to do it exactly the way I need it.
>
> Any help would be appreciated.
>
> Thank you
> Tony
>
> <HTML>
> <HEAD>
> <SCRIPT LANGUAGE="JavaScript">
>
> var sFrameName = "IFrame1";
>
> function btn1_OnClick()
> {
> alert( "this doesn't work (1)" );
> window.frames(sFrameName).document.documentElement.innerHTML =
> "This doesn't work. (1)";
> }
> function btn2_OnClick()
> {
> alert( "this works! (2)" );
> window.IFrame1.document.documentElement.innerHTML = "This works. (2)";
> }
> function btn3_OnClick( sValue )
> {
> alert( "this works! (3)" );
> window.IFrame1.document.documentElement.innerHTML = sValue;
> }
> function btn4_OnClick( sValue )
> {
> alert( "even this works! (4)" );
> eval( "window." + sFrameName +
> ".document.documentElement.innerHTML = \"" + sValue + "\";" );
> }
> function btn5_helper( sValue )
> {
> alert( "this doesn't work (5)" );
> var fnTemp = new Function( "sValue", "window." + sFrameName +
> ".document.documentElement.innerHtml = \"" + sValue + "\";" );
> fnTemp( sValue );
> }
>
> function btn5_OnClick()
> {
> btn5_helper( "This doesn't work! (5)" );
> }
>
> function btn6_helper( sValue )
> {
> alert( sValue )
> var fnTemp = new Function( "sValue", "window." +
> sFrameName + ".document.documentElement.innerHtml = sValue;" );
> fnTemp( sValue );
> }
>
> function btn6_OnClick( sValue )
> {
> btn6_helper( "This doesn't work (6)" );
> }
>
>
> </SCRIPT>
> </HEAD>
> <BODY>
> <SCRIPT LANGUAGE="JavaScript">
> document.write( "<IFRAME ID=\"" + sFrameName + "\" NAME=\"" +
> sFrameName + "\"></IFRAME>" );
> </SCRIPT>
> <INPUT
> VALUE="1"
> WIDTH=10
> TYPE="BUTTON"
> ID="btn1"
> ONCLICK="JavaScript:btn1_OnClick();">
> <INPUT
> VALUE="2"
> WIDTH=10
> TYPE="BUTTON"
> ID="btn2"
> ONCLICK="JavaScript:btn2_OnClick();">
> <INPUT
> VALUE="3"
> WIDTH=10
> TYPE="BUTTON"
> ID="btn3"
> ONCLICK="JavaScript:btn3_OnClick( 'This works! (3)' );">
> <INPUT
> VALUE="4"
> WIDTH=10
> TYPE="BUTTON"
> ID="btn4"
> ONCLICK="JavaScript:btn4_OnClick( 'Even this works! (4)' );">
> <INPUT
> VALUE="5"
> WIDTH=10
> TYPE="BUTTON"
> ID="btn5"
> ONCLICK="JavaScript:btn5_OnClick();">
> <INPUT
> VALUE="6"
> WIDTH=10
> TYPE="BUTTON"
> ID="btn6"
> ONCLICK="JavaScript:btn6_OnClick();">
> </BODY>
> </HTML>
>
>