This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.5k
Aborted JSONP request prints an error in the console #5615
Comments
arty-name
pushed a commit
to arty-name/angular.js
that referenced
this issue
Jan 3, 2014
…he console When you cancel a JSONP request, angular deletes the callback for it. However the script still executes, and since the callback is now deleted and undefined, the script throws an exception visible in the console. The quick fix for this is not to delete the callback, but replace it with `angular.noop`. Closes angular#5615
jamesdaily
pushed a commit
to jamesdaily/angular.js
that referenced
this issue
Jan 27, 2014
…he console When you cancel a JSONP request, angular deletes the callback for it. However the script still executes, and since the callback is now deleted and undefined, the script throws an exception visible in the console. The quick fix for this is not to delete the callback, but replace it with `angular.noop`. Closes angular#5615 Closes angular#5616
jamesdaily
pushed a commit
to jamesdaily/angular.js
that referenced
this issue
Jan 27, 2014
…he console When you cancel a JSONP request, angular deletes the callback for it. However the script still executes, and since the callback is now deleted and undefined, the script throws an exception visible in the console. The quick fix for this is not to delete the callback, but replace it with `angular.noop`. Closes angular#5615 Closes angular#5616
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When you cancel a JSONP request, angular deletes the callback for it. However the script still executes, and since the callback is now deleted and undefined, the script throws an exception visible in the console. Here's a demo of what happens: http://plnkr.co/edit/AlFoOUQ5P6sTgfb4SE0A?p=preview
The quick fix for this would be not to delete the callback, but replace it with
angular.noop
. The PR with this change is on the way.The better fix would be to investigate why the script executes even after being removed from DOM and tell him not to.
The text was updated successfully, but these errors were encountered: