这是我的代码:
$.getJSON(window.upperSlashes+"ajax.php", {some data here}, function(result)
{
if(result["error"] != null){return alert(result["error"]);}
}
在Firefox和Chrome上完美运行。但IE给出了这个愚蠢的错误: SCRIPT5007:无法获取属性的值'错误':对象为空或未定义
Ajax响应 - > http://i.imgur.com/yNJTX8H.jpg
已经把它放到标题中 - &gt; <meta http-equiv="X-UA-Compatible" content="IE=edge" />
也试过这个 - &gt; <meta http-equiv="X-UA-Compatible" content="IE=8" />
尝试$ .ajax而不是$ .getJSON,但它没有修复。
答案 0 :(得分:0)
改变了这个:
header('Content-type:text/json; charset=utf8');
到此:
header('Content-type:text/json');
并且错误消失了!它是固定的。