Missing text

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

    Missing text

    I have a small code. It does not print the word "hi". Why?

    <HEAD>
    <SCRIPT language=JavaSc ript>
    function listnum() {
    i=0
    do {
    document.write( i + "<br>")
    i++
    } while(i<10)
    }</SCRIPT>
    </HEAD>

    <BODY onload=listnum( )>
    hi
    </BODY>

    Thank you.
  • Evertjan.

    #2
    Re: Missing text

    chirs wrote on 12 sep 2003 in comp.lang.javas cript:
    [color=blue]
    > I have a small code. It does not print the word "hi". Why?
    >
    > <HEAD>
    > <SCRIPT language=JavaSc ript>
    > function listnum() {
    > i=0
    > do {
    > document.write( i + "<br>")
    > i++
    > } while(i<10)
    >}</SCRIPT>
    > </HEAD>
    >
    > <BODY onload=listnum( )>
    > hi
    > </BODY>
    >
    > Thank you.
    >[/color]

    Because you cannot do a document.write on a page without destroying the
    page that was there before.


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)

    Comment

    • sales@nospammers-seiretto.com

      #3
      Re: Missing text

      On 12 Sep 2003 19:17:39 GMT, "Evertjan."
      <exjxw.hannivoo rt@interxnl.net > wrote:
      [color=blue]
      >chirs wrote on 12 sep 2003 in comp.lang.javas cript:
      >[color=green]
      >> I have a small code. It does not print the word "hi". Why?
      >>
      >> <HEAD>
      >> <SCRIPT language=JavaSc ript>
      >> function listnum() {
      >> i=0
      >> do {
      >> document.write( i + "<br>")
      >> i++
      >> } while(i<10)
      >>}</SCRIPT>
      >> </HEAD>
      >>
      >> <BODY onload=listnum( )>
      >> hi
      >> </BODY>
      >>
      >> Thank you.
      >>[/color]
      >
      >Because you cannot do a document.write on a page without destroying the
      >page that was there before.
      >
      >
      >--
      >Evertjan.
      >The Netherlands.
      >(Please change the x'es to dots in my emailaddress)[/color]

      NOT quite true! Try this:
      <html>
      <head><script language="JavaS cript">
      function listnum() {
      i=0
      do {
      document.write( i + "<br>")
      i++
      } while(i<10)
      }</script>
      </head>
      <body>
      <p>hi </p>
      <script language="JavaS cript">
      listnum()
      </script>
      <p>AND hi AGAIN....</p>
      </body>
      </html>



      Dave Walker

      For PHP and MySQL demo try here:
      http://www.thedemosite.co.uk -- hey its free.
      Seiretto for Hosting Solutions that Work.

      Comment

      • Lasse Reichstein Nielsen

        #4
        Re: Missing text

        sales@nospammer s-seiretto.com writes:
        [color=blue]
        > On 12 Sep 2003 19:17:39 GMT, "Evertjan."
        > <exjxw.hannivoo rt@interxnl.net > wrote:[/color]
        [color=blue][color=green]
        > >Because you cannot do a document.write on a page without destroying the
        > >page that was there before.[/color][/color]
        [color=blue]
        > NOT quite true![/color]

        Correct. The quite true version is:

        Because you cannot do a document.write on a page that has finished
        loading, without destroying the page that was there before.

        /L
        --
        Lasse Reichstein Nielsen - lrn@hotpop.com
        Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
        'Faith without judgement merely degrades the spirit divine.'

        Comment

        • Evertjan.

          #5
          Re: Missing text

          wrote on 12 sep 2003 in comp.lang.javas cript:
          [color=blue][color=green]
          >>Because you cannot do a document.write on a page without destroying the
          >>page that was there before.[/color]
          >
          > NOT quite true! Try this:
          >[/color]

          I should have said:

          "on a page that is finished"


          --
          Evertjan.
          The Netherlands.
          (Please change the x'es to dots in my emailaddress)

          Comment

          Working...