Alex
Alex

Reputation: 55

Must a external js file contain a .js extension?

Is it okay if I use <script type="text/javascript" src="http://example.com/file"></script>

without .js at the end of the source?

Upvotes: 3

Views: 183

Answers (1)

icktoofay
icktoofay

Reputation: 129109

Yes, it's okay to omit the .js, as long as your server is configured to cope with that and will serve that URI with a 200 OK and Content-Type: text/javascript.

Upvotes: 8

Related Questions