简体   繁体   中英

IE10/11 Ajax XHR error - SCRIPT7002: XMLHttpRequest: Network Error 0x2ef3

I've been working on this problem for a few days and reaching out on this forum since I feel like I've exhausted my options. I have a form hosted on a Drupal 7 website and need to submit the form values to an external url. The form uses a POST request over the HTTPS protocol via jQuery.AJAX

  • Form works fine in Chrome, Firefox, and Safari
  • I am receiving the following error in IE10+ console (and the ajax call always goes into the error function when using IE10+):

SCRIPT7002: XMLHttpRequest: Network Error 0x2ef3, Could not complete the operation due to error 00002ef3

I've tried the following:

  • adding contentType:

     // causes all of the jQuery callbacks to error out "application/json; charset=utf-8", 
  • attempting an Ajax GET call before the actual POST (as suggested on another SO thread)

  • added header( 'Content-Type: application/json; charset=utf-8' ); to the request

  • set crossDomain: true

The appropriate CORS headers have been added and the form code is pasted below:

$.ajax({
    url: "[URL]", //the page to receive the form data  
    crossDomain: true,
    type: "POST",
    data: dataString, //posting to API 
    dataType: "json", //the data type the function should expect back from the server     
    success: function(data) {         
        if (data.response_status == "1") { //error for at least 1 field
             //display error message 
             }
             else { 
             //display thank you label next to input
             }

        } else {
           //All form fields completed successfully! Redirect user to Thank you confirmation page            
        } 
     },
    error: function(jqXHR, textStatus, errorThrown) {
             alert("there is an error!");
             console.log("in error section");
             console.log("jqXHR: " + jqXHR);
             console.log("jqXHR.responseText: " + jqXHR.responseText);
             console.log("textStatus: " + textStatus);
             console.log("errorThrown: " + errorThrown);
             data = $.parseJSON(jqXHR.responseText);
             console.log("parseJSON data: " + data);                           
    }        
    });         
  });
});

I've read SCRIPT7002: XMLHttpRequest: Network Error 0x2ef3, Could not complete the operation due to error 00002ef3

Any guidance would be helpful! THANKS

The OP provided a WireShark capture showing that the server requested a certificate using the HTTPS CertificateRequest message and the client then immediately FIN d the connection.

After configuring the server not to request a client certificate, the problem went away.

Using Fiddler also would make the problem disappear because, unless you configure it to do so, Fiddler will never request a client certificate from the browser.

I'm wondering if only the affected client machine had a matching certificate and/or whether the withCredentials flag on the CORS XHR request is relevant in this scenario.

I was seeing this error randomly with IE 8+9+10+11 Ajax calls. All other browsers did not have the problem.

It suppose there was a race-condition between KeepAlive connections. I am using Apache 2.4.7.

With the Apache 2 default settings in /etc/apache2/apache2.conf I was able to reproduce the error about every tenth Ajax call:

KeepAlive On
KeepAliveTimeout 5

Solution: Either setting

KeepAlive off

or

KeepAliveTimeout 1

solved the problem for me. I recommend anyone experiencing the 0x2ef3-Network error to fist set KeepAlive off on the server. If the error is gone, switch it on again and test with the values of KeepAliveTimeout . They can also be set to ms .

There is also a way to disable KeepAlive only for Internet Explorer.

In my environment, I first copied/pasted some old codes to take use of. So the " contentType " was "application/json" .

When I found out IE11 over windows 8 does NOT work in a very high probability, as long as I clicked submit button using my mouse. But I also found out the if I pressed the enter key in my keyboard, then it works just fine with IE11.

Note that my input elemnts and submit button were nested in a form element.

After struggling for a while, I came to this page, but didn't solve my problem, because I knew nothing about backend technologies. I was just a front-end guy with limited knowledge.

Then I tried a lot of modifications one by one. Suddenly the jQuery official API documents inspired me. I commented out the " contentType " parameter so that the " contentType " takes the default value, which is "application/x-www-form-urlencoded; charset=UTF-8" . Then problem is solved.

Hope this will help.

I had faced the same issue. For me the issue seemed to be occurring only in IE11 over a Post call, I have been using AngularJS provider $http to make the call. It seems that this is a bug in IE, and it is a certificate issue. The security certificate information is not loaded properly when the POST call is made. As a workaround, before making the POST call, make a GET call to load the certificate properly. Take a look at the example code below (it's using AngularJS)

$http({
    method: "GET",
    url: "/api/DummyGet"
}).success(
$http({
        method: "POST",
        url: "/api/PostCall",
        data: data
})
);

For further information you can take a look at these two links - http://jonnyreeves.co.uk/2013/making-xhr-request-to-https-domains-with-winjs/
- IE10/IE11 Abort Post Ajax Request After Clearing Cache with error "Network Error 0x2ef3"

I had a similar situation and after much research, the issue was a different one, but I want to post it here in the hopes that someone might find it helpful looking for the same error:

Apache had a connection timeout of 5 seconds. Internet explorer 11 on Win 7 seemed to ignore the fact that there was no active session anymore, assuming it would be 60 seconds. After changing the Apache settings to a timeout of 60 seconds, my issue was resolved.

I had this problem with an IIS application, an AJAX Post request that returned some JSON would fail, eventually returning abort, with the:

SCRIPT7002: XMLHttpRequest: Network Error 0x2ef3

error in the console. On other browsers (Chrome, Firefox, Safari) the exact same AJAX request was fine.

Further investigation revealed that the response from the server was missing the status code - in this case it should have been 500 internal error.

This was being generated as part of a C# web application using service stack that requires an error code to be explicitly set.

IE seemed to leave the connection open, eventually the network layer closed it and it 'aborted' the request; despite receiving the content and other headers.

Updating the web application to correctly return the status code fixed the issue.

Perhaps there is an issue with how IE is handling the headers in posts.

Hope this helps someone!

I had this same error in ASP.NET MVC and was finally able to get around it. I was generating a couple of hundred embedded forms in the page with each having @Html.AntiForgeryToken() . I believe this results in creating a cookie on the client side. Potentially IE was running out of space for the cookies (or something, who knows with IE). Removed it and my problem went away.

Well, I received same error on IE 11. Trying to describe what was causing it as short as possible.

  • showing site as http
  • the site makes ajax call to https
  • the ssl was self signed, but browser had no exception for it yet.
  • After the certificate exception was created, everything works fine.

Hope that helps someone.

We were seeing the same error in IE11 and Edge. A jQuery AJAX request was throwing the error XMLHttpRequest: Network Error 0x2ef3, Could not complete the operation due to error 00002ef3. consistently after exactly 300s. (Chrome & Firefox were fine)

Turned out to be an idle timeout setting on our load balancer (F5 in our case). We managed to diagnose the issue using Fiddler, which resulted in a more helpful error message in the browser: Failed to load resource: the server responded with a status of 504 (Fiddler - Receive Failure) Note that with Fiddler running, we saw this error (after 300s) in all browsers, including Chrome and Firefox.

Just want to give my take on what was the root cause of this issue for me.

We have an Angular2 app, that is calling our NodeJS REST api. The rest API then calls another service (SOAP I believe).

We found out that our SOAP service did not have the endpoint(?) in only one environment (worked everywhere else). When the NodeJS api was calling the SOAP service, the soap service was returning an error saying 'X is not a function'. When the error response was returned to NodeJS, it did not have the proper error/exception handling, so it was completely killing the service. Thus, the UI was not getting a response.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM