quote:
Originally posted by hmaster
quote:
Originally posted by -dt-
code:
code:
var m =document.getElementById('marquee');
to insert the maquee into the div.
Why, the other way works fine, its not document.write its basically like include()
IT IS DOCUMENT.WRITE LOOK AT YOUR CODE!!!!!!!!!!!!!!
innerHTML is alot better way then document.write , document.write is stupid we have a DOM for a reson people , by using document.write your basicly saying "hey i sure as hell dont care for the DOM so lets write random crap to it and hope it parses it right"
another better way (a
WAY better way) would be a full DOM approch with
code:
var orginalElement =document.getElementById('marquee');
var mElement = document.createElement('marquee');
mElement.setAttribute('direction','left');
mElement.setAttribute('style','height:20px');
mElement.setAttribute('loop','30');
mElement.setAttribute('scrollamount','2');
mElement.setAttribute('behavior','slide');
orignalElement.appendChild(mElement);
also YOUR DOCUMENT ISNT XHTML VALID if you cheat like this (thats what your doing is cheating the checker)
http://www.w3.org/MarkUp/2004/xhtml-faq#docwrite
http://ln.hixie.ch/?start=1091626816&count=1
http://www.xml.com/pub/a/2003/03/19/dive-into-xml.html