-
Notifications
You must be signed in to change notification settings - Fork 27.5k
$http success callback data undefined in IE (1.2.0 rc3) #4738
Comments
Done some further investigation and it appears that line 76 in httpBackend.js is causing this. Only in a very specific scenario! // responseText is the old-school way of retrieving response (supported by IE8 & 9) In Sharepoint 2010, where I'm running the code, in IE10 the page runs in IE8 document standards mode. As responseType is supported in IE10 it has a value of "json", response is not populated because of the IE8 document mode so response is undefined and responseText has a value in this scenario. |
Can confirm this is an issue we're seeing with IE8 & IE9. We're doing a pretty basic request and the callback function's data argument is undefined if we set the $http({
method: 'GET',
url: '/someurl',
responseType: 'json' // remove this line to make work in IE8,IE9
}).success(function(data, status, headers, config) {
console.log(data); // logs undefined in IE8, IE9
}); Removing the |
My fix ended up out of date as another change to the same file was merged before mine. At the time I was too busy to go back and update my fork, re-do the changes again and got a bit disheartened so just closed it and was fully intending to just leave it to the "experts". It still remains an issue for me so regretting giving up so easily. |
I can't reproduce this with Angular 1.2.7 on IE10 in IE8 mode. Can you please create a plunker demonstrating the problem. If this really is a problem, then it's an IE bug. we could work around it with something like:
|
You should be able to dup by using f12 tools and under document standards tab set IE8 document standards instead of standards mode. |
… set Closes angular#4464 Closes angular#4738 Closes angular#5636
… set Closes angular#4464 Closes angular#4738 Closes angular#5636
When using $http like the snippet below, in IE10 the data in the success callback is undefined. When I tested the same in v1.0.8 it worked as expected.
$http({
method: "POST",
url: "SERVICEURL",
responseType: "json",
cache: false
}).success(function(data){});
The text was updated successfully, but these errors were encountered: