Are there any reasons for why you would include JavaScript using document.writeln

Posted by David Johnstone on Stack Overflow See other posts from Stack Overflow or by David Johnstone
Published on 2010-03-16T06:04:01Z Indexed on 2010/03/16 6:06 UTC
Read the original article Hit count: 271

Filed under:

Are there any good reasons for why you would include JavaScript like this:

<script type="text/javascript">document.writeln('<script src="http://example.com/javascript/MyJavaScript.js" type="text/javascript"><' + '/script>');</script>

(Sorry for the long scrolling line. This is in the head of a HTML document.)

I've been looking at some HTML recently and I've noticed this a few times (all on the one site). I can't think of any reasons why you would do it like this, but I can hardly claim to be a web developer. It's likely that these lines of code are automatically generated, but still, someone somewhere must have thought this was a good idea.

© Stack Overflow or respective owner

Related posts about JavaScript