Are there any reasons for why you would include JavaScript using document.writeln
- by David Johnstone
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.