Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE11 returns status 0 during Ajax POST operation from an iFrame (XMLHttpRequest: Network Error 0x2ee4)

It seems that IE11 version 11.0.7 (KB2929437 on Win7, KB2919355 on Win 8.1) has a problem when performing an Ajax POST operation. The operation returns status 0 and on an F12 console, the following error appears:

SCRIPT7002: XMLHttpRequest: Network Error 0x2ee4, Could not complete the operation due to error 00002ee4.

The conditions to reproduce this issue are as follows:

  1. Happens only on specific IE11, i.e. version 11.0.7 (KB2929437 on Win7, KB2919355 on Win 8.1)
  2. iframe is used to load external page with https protocol (parent page is using http protocol)
  3. ajax with method 'POST' is used
  4. More frequently happens with Connection: Keep-Alive header set on by IIS
  5. More frequently happens on Win32 version of IE11

I created the following jsfiddle to reproduce this issue: http://jsfiddle.net/VJ2D6/12/

$(document).ready(function () {
     $('#frame').attr('src', 'https://54.249.142.247/ie11/test.html');
});

Please note that the iframe retrieves its source from another site 54.249.142.247 (hosted by EC2 node using IIS7), because jsfiddle doesn't host https. And, because I am using Self-Sign SSL Certificate, please first install the certificate to the Trusted Root, and turn off "Warn about certificate address mismatch" from Internet Options - Advanced Tab.

Inside 54.249.142.247/ie11/test.html, I created a button which initiates an Ajax POST operation to a non-existing location. Normally this request should return status 404 error (Not found). But in case of IE11 version 11.0.7, it often returns status 0 error and shows Network Error 0x2ee4 inside F12 console, "

I posted the same issue to Microsoft Connect here: https://connect.microsoft.com/IE/feedback/details/877525/ie11-returns-status-0-during-ajax-post-operation-from-an-iframe-xmlhttprequest-network-error-0x2ee4#tabs

I think this is an IE11 bug, but I am not 100% sure and there is no confirmation yet from the IE team. Please help me to confirm whether this is an IE bug, or if there is any problem in my JavaScript code.

UPDATE:

Microsoft said that they can reproduce the problem and will investigate it.

like image 520
nikoniko Avatar asked May 23 '14 03:05

nikoniko


2 Answers

This error is be cause a ssl certificate is invalid. For solve this error see: [Link]

    $.get(window.api + 'Values', null, null).done(function () {//solution for IE shit
    $.ajax({
        type: 'POST',
        url: https://api.yourdomain.com,
        data: yourData,
        success: function (data) {
            //do something
        },
    });
});
like image 182
Daniel Melo Avatar answered Nov 20 '22 15:11

Daniel Melo


I was having the same issue when trying to do a POST call to our HTTPS WCF service (CORS) and looks like it's because of the SSL Certificate. I had to recreate mine with the following MakeCert Command line

makecert.exe -r -pe -n "CN=*.YourDomain.com" -eku 1.3.6.1.5.5.7.3.1 -ss my -sr localMachine -sky exchange -sp "Microsoft RSA SChannel Cryptographic Provider" -a sha256 -sy 12 "C:\EncryptionCert.cer"

installed the created Cert into Client and server trusted root cert Auth.

After choosing this cert for my Site binding, I was able to successfully call my HTTPS WCF service in IE 11.

like image 4
Eduardo Alvarez Avatar answered Nov 20 '22 14:11

Eduardo Alvarez