[thelist] NN4.x: Repeated document.write NG with inline styles
Bill Haenel
mail at webmarketingworx.com
Mon Feb 17 11:01:15 CST 2003
Anyone know why the following JavaScript crashes NN4.x?
<script language="JavaScript">
document.write('<div style="margin-bottom:5px;">Line 1</div>');
document.write('<div style="margin-bottom:5px;">Line 2</div>');
</script>
But this works fine:
<script language="JavaScript">
document.write('<div>Line 1</div>');
document.write('<div>Line 2</div>');
</script>
And this also works fine:
<script language="JavaScript">
document.write('<div style="margin-bottom:5px;">Line 1</div>');
</script>
Please also note that changing the value in the style attribute made no
difference. It hangs the loading of the page after the first div is
written and in fact renders the browser unable to load any subsequent
pages from any other site. It also (in Windows) causes a process to hang
open which must be forced to quit before trying to use the browser
again!
Generally speaking, users didn't like this "feature" of our site very
much.
Thanks,
Bill
More information about the thelist
mailing list