【发布时间】:2011-08-24 14:42:25
【问题描述】:
我使用下面的代码 sn-p 从 google fusion table 加载数据为 json。
var fileref = document.createElement("script");
fileref.setAttribute("type", "text/javascript");
fileref.setAttribute("src", "http://tables.googlelabs.com/api/query?sql=select * from 588320&hdrs=false&jsonCallback=LoadTable");
在 IE8、FF、Chrome 中运行良好,但现在 IE9 不知道如何处理回调,因为响应和 mime 类型不匹配。 IE9 在使用 jsonCallback 参数时会报以下脚本错误,因为它不喜欢 mime 类型。
SEC7112:来自 http://tables.googlelabs.com/api/query?sql=select * 的脚本来自 588320&hdrs=false&jsonCallback=LoadTable 由于 mime 类型不匹配而被阻止。
有没有一种解决方法可以让我不必在本地托管 src(或者我做错了什么)?
Response Headers
Content-Type text/plain; charset=UTF-8
Content-Encoding gzip
Transfer-Encoding chunked
Date Fri, 13 May 2011 02:19:11 GMT
Expires Fri, 13 May 2011 02:19:11 GMT
Cache-Control private, max-age=0
X-Content-Type-Options nosniff
X-Frame-Options SAMEORIGIN
X-XSS-Protection 1; mode=block
Server GSE
Request Headers
Host tables.googlelabs.com
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language en-us,en;q=0.5
Accept-Encoding gzip, deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 115
Connection keep-alive
Cache-Control max-age=0
【问题讨论】:
-
遇到了类似的问题:
Script from https://api.twitter.com/1/statuses/user_timeline.json?callback=jsonp1314805825247&_=1314805825940&&screen_name=username_here&count=1 was blocked due to mime type mismatchIE 很棒!!!! :(
标签: types response internet-explorer-9 mime