Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Aborted JSONP request prints an error in the console #5615

Closed
arty-name opened this issue Jan 3, 2014 · 0 comments
Closed

Aborted JSONP request prints an error in the console #5615

arty-name opened this issue Jan 3, 2014 · 0 comments

Comments

@arty-name
Copy link
Contributor

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.

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
@ghost ghost assigned tbosch and jeffbcross Jan 4, 2014
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants