Forum Moderators: open

Message Too Old, No Replies

why do people split things up like this?

         

AffiliateDreamer

6:54 pm on Jul 17, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




document.write('<' + 'script');

why not just put document.write('<script>');

?

janharders

7:04 pm on Jul 17, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



because browsers might (and will) read <script> and think they should start a <script>-tag, disregarding that it's inside a string and should be treated as such. especially painful if you have some document.writeln('</script>'); in your code and wonder, why code after that line isn't executed.