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

一个奇怪的问题 jquery easyui datagrid 在IE下有时 无法接收到数据
最近在页面布局的时候用到了jquery easyui datagrid ,发现有两个页面 中的datagrid在IE中有时无法接收到数据,有时又可以 服务端部分代码:
 List<Model_RsonsPerson> rsonsPersonList = new List<Model_RsonsPerson>();
        rsonsPersonList = bllRsPerson.GetList(sqlText.ToString());
        

        Dictionary<string, object> dict = new Dictionary<string, object>();

        if (rsonsPersonList!=null)
        {
            dict.Add("total", rsonsPersonList.Count);
            dict.Add("rows", rsonsPersonList);
        }
        else
        {
            dict.Add("total", 0);
            dict.Add("rows", 0);
        }

        string temStr = JsonConvert.SerializeObject(dict);

        context.Response.Write(temStr);


  打断点发现可以执行到 Response.Write这句 tempstr的值为
{"total":2,"rows":[{"ID":8,"bumenId":216,"HotelId":15,"bumenName":"开发部"},{"ID":9,"bumenId":222,"HotelId":15,"bumenName":"测试部"}]}

格式也是对的,客户端的源代码:
$.ajax({type:opts.method,url:opts.url,data:_5c7,dataType:"json",success:function(data){
_5c8(data);
}, error: function(XMLHttpRequest, textStatus, errorThrown) {
                       alert(XMLHttpRequest.responseText); // IE10和IE8下都为空字符串
                        alert(XMLHttpRequest.status);  // IE10 下为0  IE8下为12019
                        alert(XMLHttpRequest.readyState); IE10下为0 IE8下为4
                        alert(textStatus); IE10 和IE8下都为"error"
                       
                    

//_5c9.apply(this,arguments);  原来的源代码 注释掉了
}});


在ie开发人员工具中的网络截图如下:


发出的ajax请求被终止了,请求正文和请求内容都为空, 试着设置了timeout属性也无效,这个请求之前没有其他的ajax请求,在火狐下是可以接收到数据的,实在找不出问题所在了,求指点



------解决方案--------------------
看样子是在构造请求或发送时出的错,用Post发送试一下
断点到ajax里面去查,要不就自己用js写一个
------解决方案--------------------
abort感觉是超时了被jquery自动取消请求了,和easyui没关系,你的动态页执行时间长不长?
什么版本的easyui