Serving javascript with asp.net
April 23rd, 2008 . by LorisIf you’re creating an aspx page that serves javascript, be sure to choose the application/x-javascript content encoding instead of the usual text/javascript.
I found out today that text/javascript will work fine in any browser, except for Internet Explorer. Changing it to application/x-javascript does the trick, however.
In case you’re wondering, the content type is easily changed by adding:
Response.ContentType = "application/x-javascript";
in the page_load event (or the onLoad method).