quote:
Originally posted by hmaster
I used:
code:inc_syndicate_js =
'<marquee direction="left" height="20px" loop="30" scrollamount="2" scrolldelay="2" behavior="slide">'
+ 'New site now up!'
+ '</marquee>';
// end_var_declaration
document.write(inc_syndicate_js);
And then in the webpage I used
code:
<script type="text/javascript" src="marquee.js"></script>
OH GOD!!!!!!!!!!!!!!!!!!!!!!!!!!
document.write = evil! it should never be used in xhtml docs since it can presume it needs to write to a new document and clear your page then start writing.
use something like
code:
var m =document.getElementById('marquee');
inc_syndicate_js =
'<marquee direction="left" height="20px" loop="30" scrollamount="2" scrolldelay="2" behavior="slide">'
+ 'New site now up!'
+ '</marquee>';
// end_var_declaration
m.innerHTML = inc_syndicate_js;
to insert the maquee into the div.