Msg#: 4514383 posted 9:39 pm on Oct 31, 2012 (gmt 0)
Hello to all web loverzzz. had a tiny little problem concerning this code.
</script> </p> </body> </html>
Been using Mozilla along with IE8 and chrome but cant figure out why scripts are not running at all :P
Msg#: 4514383 posted 10:23 pm on Oct 31, 2012 (gmt 0)
Thanks birdbrain! works like a charm :P cant imagine what went wrong with previous code though :/ and the one i posted earlier with the CSS im thinking it might be an issue with windows version or bit system maybe :P
Msg#: 4514383 posted 2:59 am on Nov 1, 2012 (gmt 0)
document.write does not work with XHTML. The bigger question you might want to ask yourself is should I be using XHTML? For 99% of developers, the answer is no. See this old thread: [webmasterworld.com...]
Msg#: 4514383 posted 2:11 pm on Nov 1, 2012 (gmt 0)
hmm it seems that xhtml has compatibility problems ... Well then is it ok if i stick to HTML 4.01 Strict cuz im a little afraid of what are the advantages/disadvantages of doing so .but if todays developers use HTML 4.01 (at least till HTML 5 takes on) then it is ok :P
Msg#: 4514383 posted 2:49 pm on Nov 1, 2012 (gmt 0)
Yeah, use an HTML 5 DOCTYPE, even if you don't use any of the new HTML 5 features. HTML 5 is a superset of HTML 4.01, so any valid HTML 4.01 document can use an HTML 5 doctype. Also, the HTML 5 DOCTYPE is so much easier to remember. :) <!DOCTYPE html>
Msg#: 4514383 posted 2:54 pm on Nov 1, 2012 (gmt 0)
Also, avoid using document.write, as it's generally considered bad practice to use it. Instead, use DOM methods to modify values and/or insert new content. birdbrain's example above uses the nodeValue to change the value of an existing node. Other options could include creating a new node and using appendChild or replaceChild to add it to the document.