2

This AJAX request works in Chrome/FF/Safari:

  $.ajax({
     url: 'foo.php?random=' + Math.random(),
     data: $('form#foo').serialize(),
     type: 'get',
     success: function(resp) {
        console.log(resp); // prints some HTML
     }
  });

I usually use random=' + Math.random() so IE doesn't cache AJAX responses.

Some HTML is meant to be returned from the server and HTTP response code is 200. However, with IE8, I get 200 code but an empty HTTP body.

Things I have tried:

  • dataType: 'text' # same problem
  • dataType: 'html' # same problem
  • dataType: 'jsonp' # same problem, breaks Chrome, request is local anyway

There are no server errors.

I have no idea what IE8 is trying to do :(. Any help would be great, thanks.

If I return the text "test" from the server then I get a response.

jQuery GET not reading HTML response data in IE does not solve this issue. My HTML is a single table row with about 5 cells.

Community
  • 1
  • 1
ale
  • 11,636
  • 27
  • 92
  • 149
  • 1
    Did you give a look into developer tools to try to catch any possible error? – Aguardientico Nov 18 '13 at 17:12
  • Yes. No errors but Content-Length is 0. – ale Nov 18 '13 at 17:15
  • Did you tried setting X-UA-Compatible in your server page? .php/.jsp/.asp http://stackoverflow.com/questions/14611264/x-ua-compatible-content-ie-9-ie-8-ie-7-ie-edge – Murali Mopuru Nov 18 '13 at 19:21
  • Were you able to solve it? It looks similar to this post https://stackoverflow.com/questions/18402228/web-service-error-in-jquery-while-using-internet-explorer-10/18403799#18403799 – Nereis Aug 23 '19 at 09:09

0 Answers0