IE9 script response blocked due to mime type mismatch

后端 未结 2 2017
执念已碎
执念已碎 2020-12-31 10:43

I use the following code snippet to load data from google fusion table as json.

var fileref = document.createElement(\"script\");
fileref.setAttribute(\"type         


        
相关标签:
2条回答
  • 2020-12-31 11:25

    The problem is that Google is sending an X-Content-Type-Options: nosniff declaration and returning a JavaScript file without a JavaScript MIME type. This can only be fixed by either removing the nosniff declaration or by fixing the MIME type to indicate that the file is, in fact, script.

    http://blogs.msdn.com/b/ieinternals/archive/2010/09/27/ie9-beta-google-image-search-javascript-content-type-and-nosniff.aspx

    I've sent mail to Google about this one.

    0 讨论(0)
  • 2020-12-31 11:29

    I'd just take out the fileref.setAttribute("type", "text/javascript");, since the likelyhood the mime-type will be updated by the server is unpredictable.

    0 讨论(0)
提交回复
热议问题