【发布时间】:2019-08-08 16:35:24
【问题描述】:
我们有一段代码将多个文件上传到服务器,有趣的是,这段代码在 Chrome 和 Mozilla 上运行良好,但在 Internet Explorer 中失败,收到以下错误
XMLHttpRequest:网络错误 0x2ee2,由于错误 00002ee2 无法完成操作
我们尝试了SCRIPT7002: XMLHttpRequest: Network Error 0x2ef3, Could not complete the operation due to error 00002ef3 中提到的解决方案,但仍然遇到类似问题
我们使用以下方法更改了 Internet Explorer 的超时值 this guide 但没用。
我们找出导致问题的代码行
///////////////////////////////////////////////////////////////////////
// Private Helper for making servlet calls
_servercall: function(urlStr, input, isAsync, dataT, ajaxcallback) {
// Using the core $.ajax method
$.ajax({
// the URL for the request
url : urlStr,
async : isAsync,
// the data to send (will be converted to a query string)
data : input,
// whether this is a POST or GET request
type : "GET",
// the type of data we expect back
dataType : dataT,
// code to run if the request succeeds;
// the response is passed to the function
success : function(json) {
console.log("Server call - Success");
ajaxcallback(json);
},
// code to run if the request fails; the raw request and
// status codes are passed to the function
// This needs to be better handled, more graceful error, ToDo
error : function(xhr, status) {
console.log("Server call - error. Status " + status);
JCAAlert("com.ptc.windchill.enterprise.attachments.attachmentsResource.DO_APPLET_UPLOAD_ERROR");
this.cleanupUploadFields(this.wizardStep, null);
},
// code to run regardless of success or failure
complete : function(xhr, status) {
console.log("The request is complete! Status " + status);
}
});
},
这段代码在 IE 上的文件号 12 之前都可以正常工作,但是一旦我们选择超过 12 个文件,它就会失败并出现上述错误?
这是 ajax 限制还是什么?
【问题讨论】:
-
请尝试检查您的请求需要在 IE 中完成多长时间以及您在该注册表项中设置的超时时间。确保超时值大于实际请求时间。
-
在 IE 中完成整个请求需要几分之一秒,当我保持 fiddler 开启时它可以工作,我认为 fiddler 拿着东西,但不确定我应该如何继续?
-
您能告诉我们,您目前使用的是哪个版本的IE?另请告知我们您的操作系统版本。检查与 IE 相关的更新,如果发现任何更新,请尝试安装并再次检查。
-
我安装了最新的 IE,没有更新
-
我安装了最新的 IE,没有更新请检查 IE 版本和操作系统构建imgur.com/a/hEH6nJ7 所有其他机器 IE 给出相同的错误,如果你在谷歌上搜索类似的错误,但大多数用户都面临类似的问题,但没有可行的解决方案或解决方法,似乎请求卡在 IE 或 Apache 中,但不知道从哪里开始
标签: javascript ajax apache jquery-file-upload ie11-developer-tools