document.write() not working

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ike

    document.write() not working

    Can anyone discern why the following code writes the document.write( ) lines
    literally? That is, a line like document.write( '<CENTER>') should write
    <CENTER> but instead writes the entire document.write( '<CENTER>').

    I must be really doing something stupid. Can anyone here illuminate me?
    Thanks, Ike

    <HTML><HEAD>
    <TITLE>My Applet</TITLE>
    </HEAD><BODY>
    <script language="JavaS cript">
    var sQuery = location.search .substring(1);
    sQuery.toLowerC ase();
    if(!(
    sQuery=="jake@e arthlink.net" ||
    sQuery=="jake@s elecct-right.com"
    )){
    sQuery="info@se lecct-right.com";
    }
    sQuery=sQuery+" cc:info@select-right.com";
    alert (sQuery);
    document.write( '<CENTER>')
    document.write( '<APPLET')
    document.write( 'CODE = "hline/hline.class"')
    document.write( '<PARAM NAME="RFQTo" VALUE="')
    document.write( sQuery);
    document.write( '"></APPLET>')
    </script>
    </CENTER>
    </BODY>
    </HTML>


  • LJL

    #2
    Re: document.write( ) not working

    "Ike" <rxv@hotmail.co m> wrote in
    news:3cWVb.1907 5$jH6.16410@new sread1.news.atl .earthlink.net:
    [color=blue]
    > Can anyone discern why the following code writes the document.write( )
    > lines literally? That is, a line like document.write( '<CENTER>')
    > should write <CENTER> but instead writes the entire
    > document.write( '<CENTER>').
    >
    > I must be really doing something stupid. Can anyone here illuminate
    > me? Thanks, Ike
    >
    > <HTML><HEAD>
    > <TITLE>My Applet</TITLE>
    > </HEAD><BODY>
    > <script language="JavaS cript">
    > var sQuery = location.search .substring(1);
    > sQuery.toLowerC ase();
    > if(!(
    > sQuery=="jake@e arthlink.net" ||
    > sQuery=="jake@s elecct-right.com"
    > )){
    > sQuery="info@se lecct-right.com";
    > }
    > sQuery=sQuery+" cc:info@select-right.com";
    > alert (sQuery);
    > document.write( '<CENTER>')
    > document.write( '<APPLET')
    > document.write( 'CODE = "hline/hline.class"')
    > document.write( '<PARAM NAME="RFQTo" VALUE="')
    > document.write( sQuery);
    > document.write( '"></APPLET>')
    > </script>
    > </CENTER>
    > </BODY>
    > </HTML>
    >[/color]

    There is a missing ">" after ".class". I don't know if it really makes a
    difference, but I try to end all my lines with a semicolon [;].

    Just a note, check your spelling of "select-right". Some have two "c"s and
    another has only one "c".

    Try this:

    <script language="JavaS cript">
    var sQuery = location.search .substring(1);
    sQuery.toLowerC ase();

    if(!(sQuery=="j ake@earthlink.n et" || sQuery=="jake@s elecct-right.com"))
    {
    sQuery="info@se lecct-right.com";
    }
    sQuery=sQuery+" cc:info@select-right.com";
    alert (sQuery);

    document.write( '<CENTER>');
    document.write( '<APPLET CODE = "hline/hline.class">') ;
    document.write( '<PARAM NAME="RFQTo" VALUE="'+sQuery +'">');
    document.write( '</APPLET>');
    </script>

    Comment

    • Ike

      #3
      Re: document.write( ) not working

      None of these ideas affect why this isn't writing to the html. Thanks
      ANyhow -Ike

      "LJL" <none@nowhere.c om> wrote in message
      news:Xns948AD28 94B0Bnonenowher ecom@207.69.154 .205...[color=blue]
      > "Ike" <rxv@hotmail.co m> wrote in
      > news:3cWVb.1907 5$jH6.16410@new sread1.news.atl .earthlink.net:
      >[color=green]
      > > Can anyone discern why the following code writes the document.write( )
      > > lines literally? That is, a line like document.write( '<CENTER>')
      > > should write <CENTER> but instead writes the entire
      > > document.write( '<CENTER>').
      > >
      > > I must be really doing something stupid. Can anyone here illuminate
      > > me? Thanks, Ike
      > >
      > > <HTML><HEAD>
      > > <TITLE>My Applet</TITLE>
      > > </HEAD><BODY>
      > > <script language="JavaS cript">
      > > var sQuery = location.search .substring(1);
      > > sQuery.toLowerC ase();
      > > if(!(
      > > sQuery=="jake@e arthlink.net" ||
      > > sQuery=="jake@s elecct-right.com"
      > > )){
      > > sQuery="info@se lecct-right.com";
      > > }
      > > sQuery=sQuery+" cc:info@select-right.com";
      > > alert (sQuery);
      > > document.write( '<CENTER>')
      > > document.write( '<APPLET')
      > > document.write( 'CODE = "hline/hline.class"')
      > > document.write( '<PARAM NAME="RFQTo" VALUE="')
      > > document.write( sQuery);
      > > document.write( '"></APPLET>')
      > > </script>
      > > </CENTER>
      > > </BODY>
      > > </HTML>
      > >[/color]
      >
      > There is a missing ">" after ".class". I don't know if it really makes a
      > difference, but I try to end all my lines with a semicolon [;].
      >
      > Just a note, check your spelling of "select-right". Some have two "c"s[/color]
      and[color=blue]
      > another has only one "c".
      >
      > Try this:
      >
      > <script language="JavaS cript">
      > var sQuery = location.search .substring(1);
      > sQuery.toLowerC ase();
      >
      > if(!(sQuery=="j ake@earthlink.n et" || sQuery=="jake@s elecct-right.com"))
      > {
      > sQuery="info@se lecct-right.com";
      > }
      > sQuery=sQuery+" cc:info@select-right.com";
      > alert (sQuery);
      >
      > document.write( '<CENTER>');
      > document.write( '<APPLET CODE = "hline/hline.class">') ;
      > document.write( '<PARAM NAME="RFQTo" VALUE="'+sQuery +'">');
      > document.write( '</APPLET>');
      > </script>
      >[/color]


      Comment

      • Lee

        #4
        Re: document.write( ) not working

        Ike said:[color=blue]
        >
        >Can anyone discern why the following code writes the document.write( ) lines
        >literally? That is, a line like document.write( '<CENTER>') should write
        ><CENTER> but instead writes the entire document.write( '<CENTER>').
        >
        >I must be really doing something stupid. Can anyone here illuminate me?[/color]

        I don't see that happening when I copy and paste your code.
        Are you seeing

        document.write( '<CENTER>')

        in the rendered page, or just when you view source.
        If the latter, that's normal.

        Comment

        Working...