Write into iFRAME ( IE 6 Bug?)

M

mike

Here's the code:
<html>
<body onload="setTimeout('Writing();', 1000);" topmargin=0>
<form id=Form1>
<iframe id="mainchat" src="about:blank" height=200></iframe>

<script language="javascript">
function Writing(){
window.frames[0].document.write('<a href="javascript:void(0);"
onclick="javascript:alert(\'alert\');">writing</a> ');
setTimeout('Writing()', 3000);
//alert('firing');
}
</script>

</form>
</body>
</html>


If you execute it in IE 6.0 and click on the WRITING <A> tag being
printed every 3 seconds in the iframe, it will stop writing into
iFrame, the setTimeout will still be firing but document.write command
will be ignored!!!

Works perfectly in IE 7 and Firefox.

Is there any way to make it work in IE 6 ???
 
M

mike

Here's the code:
<html>
<body onload="setTimeout('Writing();', 1000);" topmargin=0>
<form id=Form1>
<iframe id="mainchat" src="about:blank" height=200></iframe>

<script language="javascript">
function Writing(){
window.frames[0].document.write('<a href="javascript:void(0);"
onclick="javascript:alert(\'alert\');">writing</a> ');
setTimeout('Writing()', 3000);
//alert('firing');
}
</script>

</form>
</body>
</html>

If you execute it in IE 6.0 and click on the WRITING <A> tag being
printed every 3 seconds in the iframe, it will stop writing into
iFrame, the setTimeout will still be firing but document.write command
will be ignored!!!

Works perfectly in IE 7 and Firefox.

Is there any way to make it work in IE 6 ???

Fixed:

Replaced onclick="javascript:alert(\'alert\');"> with
onclick="javascript:alert(\'alert\');return false;">
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top