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.