Possible Duplicate:
Why split the <script> tag when writing it with document.write()?
I have frequently seen the following statement:
document.write("<scr");
document.write("ipt language=\"Javascript\" type=\"text/javascript\" src=\"source url\"></scr");
document.write("ipt>");
What is the advantage of this? Why don't people write the whole script, as below?
document.write("<script ");
This might help you:
http://www.webmasterworld.com/forum91/2913.htm
Depending on the browser, the amount of other preceding javascript, and how well-formed the overall code is, this is done to prevent the parser from interpreting the and tags as executeable code rather than as a string to be written.
I have found that it just saves headaches down the road if you do this when using script to write script tags.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With