Embeded JavaScript document.write's in Netscape 4.x

Giganews Newsgroups
Subject: Embeded JavaScript document.write's in Netscape 4.x
Posted by:  nick.padge…@turner.com (nickolausp)
Date: 16 Jul 2003

When embedding a JavaScript document.write within a JavaScript
document.write in Netscape 4.x (example below), the text is written
out of logical order.

<script type="text/javascript">
        <!--
        document.write('<script
type=\"text/javascript\">document.write(\'111\');<\/script>222');
        document.write('333');
        //-->
</script>

Netscape 4.x produces "111333 222".  Notice the space between the
elements and that the elements are not in order.

The correct output should be "111222333" as produced by all versions
of IE, Netscape 3.x and below, and Netscape 6.x and above.

Has anyone run into this and/or found a solution to this issue?
Please explain why this is happening and how I can fix/work-around it.

I need embeded scripts.
I need them to work in Netscape 4.x
And I need them to be in one long document.write string so please
don't ask me to seperate them.

Thank you.

Nickolaus Benjamin Padgett
nick.padge…@turner.com

Replies