Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery IE9 XmlHttpRequest返回12019错误,而不是HTTP/417响应代码_Jquery_Asp.net_Wcf_Internet Explorer - Fatal编程技术网

Jquery IE9 XmlHttpRequest返回12019错误,而不是HTTP/417响应代码

Jquery IE9 XmlHttpRequest返回12019错误,而不是HTTP/417响应代码,jquery,asp.net,wcf,internet-explorer,Jquery,Asp.net,Wcf,Internet Explorer,我在客户端处理对WCF服务的ajax请求时出错 self.remove = function (dep, processingResult) { var data = { "id": dep }; $.ajax({ url: 'my.svc/remove', type: 'POST', contentType: 'application/json',

我在客户端处理对WCF服务的ajax请求时出错

 self.remove = function (dep, processingResult) {
            var data = { "id": dep };
            $.ajax({
                url: 'my.svc/remove',
                type: 'POST',
                contentType: 'application/json',
                dataType: "json",
                cache: false,
                data: JSON.stringify(data),
                complete: function (e, xhr, settings) {
                    var message = self.getMessage(e.status);                
                    switch (e.status) {
                        case 200:
                            processingResult();
                            break;                  
                        case 417:
                            console.log(e.statusText);
                            radalert(message + e.statusText, null, null, "417");
                            break;
                        default:
                            {
                                console.log(e.statusText);
                                radalert(message, null, null, "bekey");
                            }
                    }
                }
            });
        };
在某些情况下,我返回错误417,但IE9得到的结果却是错误12019。 包括IE10在内的所有其他浏览器都获得了正确的值

为什么会发生这种情况以及如何解决

12019-错误\u互联网\u不正确\u句柄\u状态 无法执行请求的操作,因为 提供的句柄未处于正确状态

看起来返回此代码不是很好的做法。我说得对吗

  WebOperationContext ctx;
//....
  ctx.OutgoingResponse.StatusCode = System.Net.HttpStatusCode.ExpectationFailed;//417
//...

如果清除缓存没有帮助,很可能这与URLMon如何包装某些HTTP错误状态代码有关;例如,IE9及以下版本将HTTP/204响应转换为伪造的1223状态代码(请参阅)


此问题在IE10中已修复,因此服务器的响应状态已正确返回到脚本。

在旧版本的IE上出现了大量此问题。你能试试链接中的步骤吗?