Question

I am working on a web application that uses jQuery AJAX extensively. I am having an issue where IE 11 does not submit the data to the server (0-byte post).

I have made this simple jsfiddle that reproduces the problem: http://jsfiddle.net/CZGEH/6/

$("#ajax").click(function () {
    var d = {
        a: 1
    };
    alert("before: " + d.a);
    var json = JSON.stringify(d);  
    $.post("/echo/json/", { json: json}, 
           function (r) {
               alert("after: " + r.a);
           }
          );
});

It works fine on Chrome and Firefox, showing the value before and after, but in IE11, the request body is empty, and of course nothing is returned from the echo because nothing was sent. I've verified that the POST is empty using the network panel of the IE F12 Developer tools.

UPDATE: Fiddle capture

Key Value
Request POST /echo/json/ HTTP/1.1
Accept  */*
Content-Type    application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With    XMLHttpRequest
Referer http://jsfiddle.net/CZGEH/6/show/
Accept-Encoding gzip, deflate
User-Agent  Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
Host    jsfiddle.net
Content-Length  0
Connection  Keep-Alive
Cache-Control   no-cache
Cookie  __utma=210580238.1033480112.1361288166.1398353560.1398356067.4;             __utmz=210580238.1398353560.3.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); csrftoken=bknsZsUQNq1vkwRg0jUjYUJajySxummK

UPDATE: It was the "Google Gears Helper" add on being enabled that was breaking the script. The script is not using the pluggin, and it was actually very simple. I still dont know why is it breaking, but disabling the add on removes the problem. Marking as answer, thanks Erick!!

Any suggestions? Thanks.

Was it helpful?

Solution

Testing this with the current version of IE11 with all updates, the message box is shown twice and the HTTP form is POST'd to the server. As seen in Fiddler:

  POST http://fiddle.jshell.net/echo/json/ HTTP/1.1
  Accept: */*
  Content-Type: application/x-www-form-urlencoded; charset=UTF-8
  X-Requested-With: XMLHttpRequest
  Referer: http://fiddle.jshell.net/CZGEH/6/show/
  Accept-Language: en-US,en;q=0.5
  Accept-Encoding: gzip, deflate
  User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko
  Host: fiddle.jshell.net
  Content-Length: 22
  Connection: Keep-Alive
  Pragma: no-cache

  json=%7B%22a%22%3A1%7D

Please verify that you can reproduce this in No Add-ons mode in the browser, and verify that you do not have any 3rd party "Download Manager" plugins or other extensions (like Google Gears) that thunk IE's network stack installed.

Extensions using undocumented means to alter IE's network stack are known to have bugs which cause 0-byte POSTs.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top