Jocelyn,

The following comes from pages 214-215 of O'Reilly's "Javascript: The Definitive Guide"

With regard to opening up a new window or frame:

'...the HTML parser doesn't know about quoted strings, so if you write out a string
         that contains the characters "</SCRIPT>", the HTML parser terminates the 
currently
         running script.  To avoid this problem, simply break up the tag into 
pieces...like...

document.write("</" + "SCRIPT>");

'

Alternatively you might use the backslash character to escape the slash character, as 
in:

document.write("<\/"SCRIPT>");

Hope this helps.

Frank Staheli
Brigham Young University


Jocelyn Kwok <[EMAIL PROTECTED]> wrote:
>Hi all,>
>I am trying to create a dynamic HTML page from ND5 by using
>document.write( ) inside a javascript function. My code below will open
>up a new window and the html tags will be created on the fly. When I ran
>this application, there is an error on the "newWin.document.write(
>"</script>" ); " line. It seems to me that </script> hasn't been
>recognized as part of
>the dynamic HTML. Instead, </script> became a closing tag for my ND
>script tag.
>The following codes work fine as a normal html page.
>
>Any suggestion for the problem?
>
>Thanks
>Jocelyn
>-------------------------------------------------
>Here is my code:
>
><HTML>
><HEAD>
><TITLE>pgOne</TITLE>
></HEAD>
><body background="/NetDynamics/NetDynamics50/images/ndBackground.gif"
>bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080"
>alink="#FF0000">
>[[SPIDERPAGE NAME=pgOne]]
>
><script language=javascript>
>
>function openWin(URL){
>
>        newWin = window.open(URL);
>
>        newWin.document.write( "<html><head><title>New Page</title>" );
>        newWin.document.write( "<script language=javascript>" );
>        newWin.document.write( "function testagain(){} " );
>        newWin.document.write( "</script>" );    //  PROBLEM LINE
>        newWin.document.write( "</head>" );
>        newWin.document.write( "<body>" );
>        newWin.document.write( "<table border=1 cellpadding=2
>width=100%><tr>" );
>        newWin.document.write( "<td align=center width=15%>" +
>document.pgOne.tbName.value + "</td>" );
>        newWin.document.write( "<td align=center width=20%><a
>href='www.cnn.com'>www.cnn..com</a></td>" );
>        newWin.document.write( "</tr></table></body>" );
>        newWin.document.write( "</html>" );
>}
>
></script>
>
><BR>
><TABLE BORDER=0 CELLSPACING=2 CELLPADDING=2 WIDTH=100%>
><TR>
><TD ALIGN=RIGHT VALIGN=MIDDLE WIDTH=20%><B></B></TD><TD ALIGN=LEFT
>VALIGN=MIDDLE>**tbName**</TD>
><TD ALIGN=RIGHT VALIGN=MIDDLE WIDTH=20%><B></B></TD><TD ALIGN=LEFT
>VALIGN=MIDDLE>**tbEmail**</TD>
><TD ALIGN=RIGHT VALIGN=MIDDLE WIDTH=20%><B></B></TD><TD ALIGN=LEFT
>VALIGN=MIDDLE>**hrOpen**</TD>
></TR>
></TABLE>
>
>**SPIDERSESSION**
>[[/SPIDERPAGE]]
></BODY>
></HTML>
>
>
>

_________________________________________________________________________

For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html

For dire need help, email: [EMAIL PROTECTED]

Reply via email to