You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
when cancelling an xhr request, IE9 throws error in console ( Could not complete the operation due to error c00c023f. ) and error callback of the promise doesn't get called.
App
<divng-app="queryApp" ng-controller="QueryCtrl"><inputtype="button" ng-click="send()" value="SendQuery"><br/>
<inputtype="button" ng-click="cancel()" value="CancelQuery"/>
<p>status: {{status}}</p></div><scriptsrc="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.js"></script><script>angular.module('queryApp',[]).service('QueryService',function($http,$q,$timeout){vardeferred=null,timer=null;return{cancelQuery: function(){deferred.resolve();},sendQuery: function(query){/** * cancel previous request if there was any. */if(deferred){this.cancelQuery();}deferred=$q.defer();this.startTimeout();return$http.get('/data',{timeout: deferred.promise}).then(function(response){returnresponse.data;});},startTimeout: function(){this.stopTimeout();varself=this;timer=$timeout(function(){self.cancelQuery();},3000);},stopTimeout: function(){if(timer){$timeout.cancel(timer);}}}}).controller('QueryCtrl',function($scope,QueryService){$scope.status='init';$scope.cancel=function(){$scope.status='canceled';QueryService.cancelQuery();};$scope.send=function(){$scope.status='loading...';QueryService.sendQuery().then(function(){$scope.status='done!';},function(){/** * IE doesn't run into this block. */$scope.status='timeout';});};});</script>
Server
varexpress=require('express'),http=require('http'),app=express();app.set('port',process.env.PORT||666);app.use(express.static(__dirname+'/public',{maxAge: 666}));app.get('/data',function(req,res){res.type('application/json');setTimeout(function(){res.send({});},6000);});http.createServer(app).listen(app.get('port'),function(){console.log('Express server listening on port '+app.get('port'));});
The text was updated successfully, but these errors were encountered:
When a request is aborted, it makes no sense to read the response headers or text.
Also in IE9, trying to read data (either response headers or text) from an aborted request
throws an Error c00c023f.
Fixesangular#4913
When a request is aborted, it makes no sense to read the response headers or text.
Also in IE9, trying to read data (either response headers or text) from an aborted request
throws an Error c00c023f.
Fixesangular#4913Closesangular#4940
jamesdaily
pushed a commit
to jamesdaily/angular.js
that referenced
this issue
Jan 27, 2014
When a request is aborted, it makes no sense to read the response headers or text.
Also in IE9, trying to read data (either response headers or text) from an aborted request
throws an Error c00c023f.
Fixesangular#4913Closesangular#4940
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
when cancelling an xhr request, IE9 throws error in console ( Could not complete the operation due to error c00c023f. ) and error callback of the promise doesn't get called.
App
Server
The text was updated successfully, but these errors were encountered: