|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
<DIV> tags in FF,NN,exc.
How can i reload the contents of a <DIV> tag in other browsers then IE, in IE i use div.innerHTML="";
is there a way to let this work in FF, NN, Opera, exc. ?? colton22 |
|
#2
|
||||
|
||||
|
Dom
I think it should work if you use the DOM like I posted in your CSS thread. ie. var = "get" the element. var.innerHTML = "new content".
If innerHTML doesn't work, maybe create a text node and then replaceChild. |
|
#3
|
||||
|
||||
|
i will try the above. Anyway in ALL but IE the following does not work...
DIVID.innerHTML=""; colton22 |
|
#4
|
||||
|
||||
|
Perhaps you're not using Javascript's DOM correctly... innerHTML works in most cases, but it tends to be avoided... that's a different lecture.
Here's an example of a working innerHTML... Code:
<html>
<head>
<title>Hello World?</title>
<script type="text/javascript">
function changeText() {
document.getElementById('helloWorld').innerHTML = 'Goodnight Seattle';
}
</script>
</head>
<body onload="changeText()">
<div id="helloWorld">Hello World!</div>
</body>
</html>
__________________
Daryl's Homepage | My Blogroll | My Profile | Firefox supporter! DevArticles Forum Moderator "The net is a waste of time, and that's exactly what's right about it." -- William Gibson |
|
#5
|
||||
|
||||
|
thanks man,
one more step closer... lol colton22 |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > <DIV> tags in FF,NN,exc. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|