New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ajaxError and ajaxComplete firing twice upon abort #1775
Comments
|
Comment author: dmethvin Looks like this has been around for a while. Aborting happens synchronously and cleans up the request to avoid memory bloat. Then when it gets back from the ajaxSend it actually tries to send the request and the XHR object was blown out from under it. Aborting the request doesn't make a lot of sense at that point, you can see from the XHR spec that it's pretty much a no-op if called before a .send(). So it seems more appropriate to have ajaxSend indicate that it doesn't want the request to proceed in some other way. The concern I'd have with making a change there would be compat. At least we know aborting doesn't currently work. I'll mark this open for discussion. |
|
Comment author: Azriel I've opened a PR with a suggested solution to this here: https://github.com/jquery/jquery/pull/1619 |
|
Hey, I am relatively new to open source/github. I would like to start contributing to projects soon. Out of curiosity and a desire to learn how to make effective contributions in the future, I want to ask why the PR hasn't been merged yet? |
|
Hey @jabelman I took a look at the earlier and think it's fine. @jaubourg or others, any comments on gh-1619? Quite often we batch these things up and don't get serious about landing PRs until we start the push for a new version. If you've already signed our CLA you're in good shape and we will land it soon. Thanks for contributing! |
|
The PR looks good to me |
Originally reported by Dwelle at: http://bugs.jquery.com/ticket/15160
Aborting jqXHR objects inside ajaxSend results in ajaxError and ajaxComplete callbacks being called twice. On first execution, jqXHR's status is "abort", on second execution, it throws TypeError: Cannot read property 'send' of undefined .
JSFiddle: http://jsfiddle.net/LK2g3/
tested on Chrome 35, FF 30, jQuery 1.9.1, 1.11.1, 2.1.1
Issue reported for jQuery 1.11.1
The text was updated successfully, but these errors were encountered: