I want to replace the innerHTML of a DIV tag. This works great in IE but I need it to work in netscape too....
The DIV has an ID...
/Smirre
Printable View
I want to replace the innerHTML of a DIV tag. This works great in IE but I need it to work in netscape too....
The DIV has an ID...
/Smirre
:rolleyes:Code:<html>
<head>
<script language="JavaScript"><!--
if(navigator.appName=='Netscape')
{
alert('Use a proper browser you fool!')
}
//--></script>
</head>
<body>
</body>
</html>
document.getelementbyid('div_id').innerhtml="blah";
innerHTML works in netscape 6 but not 4
Try this cross browser code that I use.Code:document.getElementById("objectid").innerHTML='newdata';
Call it like this...Code:function writeText(objectID,txt){
if (document.getElementById){
document.getElementById(objectID).innerHTML=txt;
}else if (document.all){
document.all(objectID).innerHTML=txt;
}else if (document.layers){
document.layers[objectID].document.open();
document.layers[objectID].document.write(txt);
document.layers[objectID].document.close();
}
}
Code:writeText('div1','This is some text. Ill be written to the object div1');
how could I modify this to get a script from the server. Something like http://mysite/myinnerhtml.inc .....
Not sure what you mean? SSI?