Forum Moderators: open

Message Too Old, No Replies

Netscape 7, iFrame, and setTimout

         

a_traub

8:37 pm on May 30, 2003 (gmt 0)

10+ Year Member



The following two pages work fine with IE but not with NS 7 where they run for a few seconds and then stop:

page 1:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
</head>
<body>
<div id="test">
<iframe id="textframe" name="textframe" frameBorder="0" width="370"
height="220" src="time.htm"></iframe>
</div>
<script language="javascript">

function refresh()
{
if (document.layers)
{
document.layers.textframe.document.src= "time.htm";
}
else if (document.all)
{
document.all.textframe.src = "time.htm";
}
else if (document.getElementById)
{
document.getElementById("textframe").src = "time.htm";
}
}

</script>
<script language='javascript'>
function refresher()
{
refresh();
setTimeout('refresher()',2000);
}
setTimeout('refresher()',2000);
</script>

</body>
</html>

time.htm:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Untitled</title>
</head>

<body>
<span id="currentTime"></span>
<script language="javascript">
function timeDisplay()
{
d = new Date;
if (document.layers)
{
document.layers.currentTime.document.write(d.toString());
document.layers.currentTime.document.close();
}
else if (document.all)
{
currentTime.innerHTML = d.toString();
}
else if (document.getElementById)
{
document.getElementById("currentTime").innerHTML = d.toString();
}
}
timeDisplay();
</script>

</body>
</html>

BlobFisk

8:45 pm on May 31, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld, a_traub!

Have you checked the JavaScript console on Netscape to see where it has the problem? On your page type javascript: into the location bar.

a_traub

2:33 pm on Jun 2, 2003 (gmt 0)

10+ Year Member



Thanks for the tip, but no errors found.

Andrew