Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Must a external js file contain a .js extension?

Tags:

javascript

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

without .js at the end of the source?

like image 962
Alex Avatar asked Dec 27 '25 16:12

Alex


1 Answers

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.

like image 171
icktoofay Avatar answered Dec 30 '25 04:12

icktoofay



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!