Prev: FAQ Topic - Why does K = parseInt('09') set K to 0? (2010-04-01)
Next: regd window.external object
From: Jivanmukta on 31 Mar 2010 22:48 Hello, I am learning JavaScript and I have a question: I have read somewhere in Internet that document.write() should not be used. Is this true? Why? Thanks for information.
From: David Mark on 31 Mar 2010 22:59 Jivanmukta wrote: > Hello, > I am learning JavaScript and I have a question: > I have read somewhere in Internet that document.write() should not be > used. You'll find lots of ill-conceived generalizations on the Internet. Just recently I read that you should not put SCRIPT elements in the BODY as it would make some unnamed "progressive enhancement" people mad. :) > Is this true? Why? No, the generalization is not true. It's not true because there can be good reasons for using document.write, particularly where the alternatives are completely unworkable (e.g. synchronous XHR--see Dojo). Personally, I find it useful to inject style sheets to prevent FoUC. Of course, there are alternative workable ways to do that, but not nearly as compatible. > Thanks for information. NP.
|
Pages: 1 Prev: FAQ Topic - Why does K = parseInt('09') set K to 0? (2010-04-01) Next: regd window.external object |