[英]ajax request aborted in mvc project
当我们尝试将json数据发布到MVC项目中的服务器时。 firebug显示请求已中止。
我相信当exec被发布到iis服务器请求中止时,当我们从textarea请求发布中删除exec并保存数据时,它的内容相当合理。
谁能面对类似的问题? 我们正在使用jquery 1.7版本。
function PostData(url, methodname, jsondata, callbackfunction) {
if (jsondata == '') {
$.ajax({
type: "POST",
//async: "true",
contentType: "application/json",
dataType: "json",
url: baseUrl + url + "/" + methodname,
success: function (html) {
if (html != null) {
if (html.IsSessionExpired != null) {
if (html.IsSessionExpired == true) {
window.location.href = baseUrl + "/";
return;
}
}
}
if (typeof callbackfunction == "function") {
callbackfunction(html);
}
else {
eval(callbackfunction + "(" + JSON.stringify(html) + ")");
}
},
error: function (request, status, error) {
},
timeout: 300000 // Set timeout of 3 minutes
});
}
else {
$.ajax({
type: "POST",
async: "false",
contentType: "application/json",
dataType: "json",
url: baseUrl + url + "/" + methodname,
data: JSON.stringify(jsondata),
success: function (html) {
if (html != null) {
if (html.IsSessionExpired != null) {
if (html.IsSessionExpired == true) {
window.location.href = baseUrl + "/";
return;
}
}
}
if (typeof callbackfunction == "function") {
callbackfunction(html);
}
else {
eval(callbackfunction + "(" + JSON.stringify(html) + ")");
}
},
error: function (request, status, error) {
},
timeout: 300000 // Set timeout of 3 minutes
});
}
}
请求仅在2秒钟后中止。 我尝试设置超时时间,但无法锻炼。
与iis设置有关吗? 我们可以在本地环境中设置那些设置吗?
提前致谢!
data: JSON.stringify(jsondata)
第一次通话时失踪
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.