View Single Post
  #4 (permalink)  
Old July 19th, 2005, 01:26 AM
joefawcett's Avatar
joefawcett joefawcett is offline
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

You can only "document.write" to an open page, one that has not finished loading and rendering. To adjust content after loading there are many options but the most standard is to use the innerHTML property. For example if you have a div with an id of "divMessage" then to change this:
Code:
<div id="divMessage">Hello world</div>
to this:
Code:
<div id="divMessage">Hello Lar</div>
use this script:
Code:
var oMessageDiv = document.getElementById("divMessage");
oMessageDiv.innerHTML = "Hello Kar";
So you need to set up a div or a span to hold your marquee element.

As a side issue there's not much point worrying about cross browser compatibility with your code as "marquee" is IE only.

--

Joe (Microsoft MVP - XML)
Reply With Quote