我从asp.net页面发送请求,然后等待响应,通过setInterval的方法调用GetCommand:ajax响应数据的最大大小是多少?
function GetCommand(id, sid) {
getCommandResponse = $.ajax({
type: "POST",
async: true,
url: "../WebServices/TSMConsole.asmx/GetCommand",
data: "{'param' : '" + id + "', 'sid' : '" + sid + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(result, status) {
AjaxFinishedGet(result, status);
getCommandResponse = null;
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
AjaxFailedGet(XMLHttpRequest, textStatus, errorThrown);
getCommandResponse = null;
}
});
}
在AjaxFinishedGet(结果状态),我尝试提取我的数据:
function AjaxFinishedGet(xml, status) {
endDate = new Date();
if (xml.d.IsPending == 'false' || endDate - startDate > timeoutMSec) {
if (getCommand != null) {
window.clearInterval(getCommand);
getCommand = null;
WriteGetCommand(xml.d.Text);
$("#showajax").fadeOut("fast");
}
}
}
但是,如果文本大小超过102330字节 - 而不是AjaxFinishedGet,AjaxFailedGet被称为:(
我还没有找到任何有关ajax响应数据大小的限制,也没有发现任何有关javascript变量大小的信息,至少这样变量可以保持1MB没有问题。其实Text可能包含1MB的数据...
问题在哪里?
抛出什么错误?你使用哪个网络服务器? – 2009-11-10 17:51:50