Does an external .js file require internal and containing tags to work?
+5
A:
No they're not needed, in fact you'll get a syntax error if you include them.
Your .js files should contain only JavaScript, no HTML tags around it, like would have inside a page.
Nick Craver
2010-10-04 23:45:26
+3
A:
No, it does not. The external file just needs the code.
Then you just need to do <script src="file.js" type="text/javascript"></script>.
Rocket
2010-10-04 23:45:57
I would add a stronger warning here, not only are tags not needed, they'll actually FUBAR things :)
Nick Craver
2010-10-04 23:57:26