J
johnsonlau
When I use document.write to replace the comment of a frame,
I found that the page was always showing as loading in Firefox
(2.0.0.2).
But it seems that it is OK in IE6.
Could someone help me with this problem?
Thanks.
My file:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script>
function writeWindow (w2) {
var w = w2.open('','_self');
w.document.open();
var a = [
'<html><head><title>No bugs</title>',
'<script language="JavaScript" src="js/jsInclude.js"><\/script>',
'<script language="JavaScript">function timerOut()
{alert("test"); }function t() {var timerObj = new Timer(5000,
timerOut);timerObj.start();}<\/script>',
'</head><body onload="javascript: t()">',
' <h1>It works</h1>',
'<p>Add lots more HTML here...</p>',
'</body></html>',
];
var d = w.document;
w.document.write(a.join(''));
d.close();
}
function load() {
writeWindow(top._displayFrame1);
}
function test() {
window.setTimeout(load, 2000);
}
</script>
</head>
<frameset name="frames" id="frames" cols="1024,0" frameborder="0"
border="0" onload="test()">
<frameset id = "_displayFrames" cols="800,200" frameborder="0"
border="0">
<frame src="about:blank" name="_displayFrame1" id="_displayFrame1"
border="no" />
<frame src="about:blank" name="_displayFrame2" id="_displayFrame2"
border="no" />
</frameset>
<frame src="about:blank" id="ControlFrame" name="ControlFrame"
border="no" />
<noframes>
</noframes>
</frameset>
</html>
I found that the page was always showing as loading in Firefox
(2.0.0.2).
But it seems that it is OK in IE6.
Could someone help me with this problem?
Thanks.
My file:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script>
function writeWindow (w2) {
var w = w2.open('','_self');
w.document.open();
var a = [
'<html><head><title>No bugs</title>',
'<script language="JavaScript" src="js/jsInclude.js"><\/script>',
'<script language="JavaScript">function timerOut()
{alert("test"); }function t() {var timerObj = new Timer(5000,
timerOut);timerObj.start();}<\/script>',
'</head><body onload="javascript: t()">',
' <h1>It works</h1>',
'<p>Add lots more HTML here...</p>',
'</body></html>',
];
var d = w.document;
w.document.write(a.join(''));
d.close();
}
function load() {
writeWindow(top._displayFrame1);
}
function test() {
window.setTimeout(load, 2000);
}
</script>
</head>
<frameset name="frames" id="frames" cols="1024,0" frameborder="0"
border="0" onload="test()">
<frameset id = "_displayFrames" cols="800,200" frameborder="0"
border="0">
<frame src="about:blank" name="_displayFrame1" id="_displayFrame1"
border="no" />
<frame src="about:blank" name="_displayFrame2" id="_displayFrame2"
border="no" />
</frameset>
<frame src="about:blank" id="ControlFrame" name="ControlFrame"
border="no" />
<noframes>
</noframes>
</frameset>
</html>