-
Apr 25th, 2002, 05:16 AM
#1
Thread Starter
Hyperactive Member
InnerHTML, how do I do this with Netscape??
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
Visual Basic
C, C++
Java
Access
SQL Server
MCP, MCSD
-
Apr 25th, 2002, 07:27 AM
#2
Addicted Member
Code:
<html>
<head>
<script language="JavaScript"><!--
if(navigator.appName=='Netscape')
{
alert('Use a proper browser you fool!')
}
//--></script>
</head>
<body>
</body>
</html>
Another light-hearted post from Guru
-
Apr 25th, 2002, 07:49 AM
#3
Lively Member
document.getelementbyid('div_id').innerhtml="blah";
-
Apr 25th, 2002, 07:53 AM
#4
Fanatic Member
innerHTML works in netscape 6 but not 4
Code:
document.getElementById("objectid").innerHTML='newdata';
Try this cross browser code that I use.
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();
}
}
Call it like this...
Code:
writeText('div1','This is some text. Ill be written to the object div1');
-
Apr 25th, 2002, 07:59 AM
#5
Fanatic Member
how could I modify this to get a script from the server. Something like http://mysite/myinnerhtml.inc .....
-
Apr 25th, 2002, 09:21 AM
#6
Fanatic Member
Not sure what you mean? SSI?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|