Web Analytics Made Easy -
StatCounter document.write behaves weird - CodingForum

Announcement

Collapse
No announcement yet.

document.write behaves weird

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • document.write behaves weird

    I have a script which should display a webpage and then (hopefully) after a 4 second delay, change the last line to say something else. I'm doing the whole page in script (so as not to run into multiscripting problems) and use document.write to write to the page. My final line is

    self.setTimeout("document.write(quotes[0])", 4000)

    where quotes is an array of strings. This line "works", but the text is displayed on a white background at the top...it removes all the previous html and writes only this! So what you see is my webpage without this line, wait 4 seconds, which page with this string at the top. If I just call document.write("quotes[0]") the script does what I want it to do (writes that string to the end of the file). Any clues?

    -Reuben

    P.S. Also, if someone knows how I can remove the previous line of text and replace it with a new one, it'd be awesome if you could tell me. TIA.

  • #2
    Ok, so how can I do this? Do I have to make an input form and update that? I really don't like the way that looks. Anybody have a solution where I can change the text in the page?

    -Reuben

    Comment


    • #3
      Thanks Dave! I think I got it now.

      -Reuben

      Comment

      Working...
      X