The correct way to code for a js source?

as long as the server is set to use application/javascript for scripts.

Note that text/javascript was deprecated a long time ago - the only reason people continued using it was that before IE9 Internet Explorer didn’t run JavaScript but ran jScript instead which would run with text/javascript as the MIME type but not the correct JavaScript one.

I still include the type=“application/javascript” when using script tags as I suspect that the shared hosting I am using has the wrong type set.

1 Like