Candyass
09-24-2002, 07:37 AM
OK I give up :)
Is there any way to use innerHTML in NS4.75, or some other way to accomplish the same as I do in IE with the code below?
I just want to replace the content in a <div></div> based on the parameter passed to the function. Here's my IE code:
function ShoworNot(mama)
{
var str = "";
oOpt = document.all("imageSwap");
if(mama==1)
{
str = "<TABLE cellpadding='0' cellspacing='0' border='0' height='100%'>"
str += "<TR><TD background='bodybg1.gif'><img src='clear.gif'></TD></TR>"
str += "<TR><TD height='7' valign='top'><img src='bodybtm1.gif' height='7'></TD></TR>"
str += "</TABLE>"
oOpt.innerHTML = str
}
else if(mama==2)
{
str = "<TABLE cellpadding='0' cellspacing='0' border='0' height='100%'>"
str += "<TR><TD background='bodybg2.gif'><img src='clear.gif'></TD></TR>"
str += "<TR><TD height='7' valign='top'><img src='bodybtm2.gif' height='7'></TD></TR>"
str += "</TABLE>"
oOpt.innerHTML = str
}
}
---------------------------------------- then the body......
<BODY onLoad="ShoworNot('1')"
<form name="hi">
<TABLE>
<TR>
<TD background="clear.gif" valign="bottom">
<div id="imageSwap">a</div>
</TD>
</TR>
</TABLE>
</form>
</BODY>
Thanks (and nice to see you guys are still around!)
Matz
Is there any way to use innerHTML in NS4.75, or some other way to accomplish the same as I do in IE with the code below?
I just want to replace the content in a <div></div> based on the parameter passed to the function. Here's my IE code:
function ShoworNot(mama)
{
var str = "";
oOpt = document.all("imageSwap");
if(mama==1)
{
str = "<TABLE cellpadding='0' cellspacing='0' border='0' height='100%'>"
str += "<TR><TD background='bodybg1.gif'><img src='clear.gif'></TD></TR>"
str += "<TR><TD height='7' valign='top'><img src='bodybtm1.gif' height='7'></TD></TR>"
str += "</TABLE>"
oOpt.innerHTML = str
}
else if(mama==2)
{
str = "<TABLE cellpadding='0' cellspacing='0' border='0' height='100%'>"
str += "<TR><TD background='bodybg2.gif'><img src='clear.gif'></TD></TR>"
str += "<TR><TD height='7' valign='top'><img src='bodybtm2.gif' height='7'></TD></TR>"
str += "</TABLE>"
oOpt.innerHTML = str
}
}
---------------------------------------- then the body......
<BODY onLoad="ShoworNot('1')"
<form name="hi">
<TABLE>
<TR>
<TD background="clear.gif" valign="bottom">
<div id="imageSwap">a</div>
</TD>
</TR>
</TABLE>
</form>
</BODY>
Thanks (and nice to see you guys are still around!)
Matz