I’m making an XMLHttpRequest using ExtJS to a service that returns no responseText, just a 204 and the response header TotalNearby. The call works perfectly using Firefox, but with Internet Explorer 8, both alert boxes are empty. What am I doing wrong?
Ext.Ajax.request({
url: 'services/getNearby',
method: 'GET',
params: {
'lat': 34,
'lon': -90
},
headers: {
'Authorization': AUTH_TOKEN
},
success: function(response) {
if (response.status == 204) {
alert(response.getAllResponseHeaders());
alert(response.getResponseHeader('Total-Nearby'));
}
},
failure: function(response) {
alert('Server status ' + response.status);
}
});
According to the site http://www.enhanceie.com/ie/bugs.asp this is an IE 7/8 bug:
If you are seeing empty alerts, meaning IE did not change the status code to 1223, then that part of the bug may have been fixed. However, I would be more worried about the statement:
as this appears to be the problem you’re facing. Do you need to use a service that does not respond with content? You might be better suited to return a typical response with a message body.