日期:2014-05-16  浏览次数:20677 次

求教:IE读取json数据为undefined,其它浏览器都是好的。
ajax代码:
$.ajax({type:"get",url:"aa.php",async:false,dataType:'json',jsonp:'jsonpcallback',timeout:500,
    success:function(json){
        alert(json.install); // 此处数据在chrome应该为1,在IE浏览器中为undefined
    }
});

aa.php页面数据:
{
    "install":1,
    "start":"yes",
    "currentRequestTime":0
}
json ie

------解决方案--------------------
timeout:500,

timetou是毫秒为单位,你这个0.5s就超时太短了吧,可能是ie下请求超时了
------解决方案--------------------
同意楼上,可以把超时时间设置大一点