Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Embeded JavaScript document.write's in Netscape 4.x

Reply
Thread Tools

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

 
 
nickolausp
Guest
Posts: n/a
 
      07-17-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
http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
 
 
 
Dom Leonard
Guest
Posts: n/a
 
      07-18-2003
nickolausp wrote:
> 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.
>

<SNIP>

Ensuring the embedded script tag is the last thing written by a single
call to document.write seems to achieve correct rendering results when
tested under NS 4.72. The corollary is that placing extra content after
an embedded '<\/script>' end tag, or including extra parameters in the
document write call to achieve the same result, produces predictable
rendering failures under NS4.

Any solution to an NS4 bug, however, needs to be tested against actual
document structure and conditions in which it is expected to function.

Good luck,
Dom

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Button stops firing click event when JavaScript file is embeded after upgrade to IE7 Sunny ASP .Net 2 03-21-2007 08:39 AM
Why can't JavaScript work when embeded in Perl CGI code? Dave Perl Misc 9 02-21-2006 01:56 AM
Netscape 7.1 to Netscape 8 Skid Schermerhorn Firefox 2 09-05-2005 04:04 PM
Netscape with JRE 1.5 beta 1 ignores Netscape signing Mickey Segal Java 1 05-21-2004 01:52 PM
websphere, oracle, netscape: netscape timeout Tom Java 0 08-01-2003 11:03 PM



Advertisments