ucla-oarc-mobile / mwf

UCLA Mobile Web Framework
http://mwf.ucla.edu
Other
86 stars 25 forks source link

JS Handler uses obsolete content type #154

Closed Trott closed 12 years ago

Trott commented 12 years ago

HTTP headers for JS files should use application/javascript as the content type. text/javascript is obsolete. See http://www.rfc-editor.org/rfc/rfc4329.txt

Trott commented 12 years ago

Note that <script> tags should still use text/javascript for the type attribute (or better yet just omit the type attribute altogether--totally valid in HTML5). IE does not like application/javascript in <script> tag's type attribute. But that's the <script> tag. This issue is being filed about the HTTP header in the header() function in PHP. That should be application/javascript.

ebollens commented 12 years ago

The reason that text/javascript is used in the HTTP header was simply because that's the type being used in the script tag as well.