首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Ajax >

IE读取json数据为undefined,其它浏览器都是好的

2013-02-03 
求教:IE读取json数据为undefined,其它浏览器都是好的。ajax代码:$.ajax({type:get,url:aa.php,async:fa

求教: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下请求超时了
[解决办法]
同意楼上,可以把超时时间设置大一点

热点排行