Does an external .js file require <script> tags?

TroubledGuym picture TroubledGuym · Oct 5, 2010 · Viewed 28.5k times · Source

Does an external .js file require internal and containing tags to work?

Answer

Nick Craver picture Nick Craver · Oct 5, 2010

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.