-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Aborting ajax requests #221
Comments
ajaxSubmit() and ajaxForm() don't return the XHR object, but the XHR object is passed as the first parameter to the beforeSend callback. So you can get the XHR object by specifying a beforeSend callback, and saving that XHR object to a variable in that callback. Then when you want to abort the upload, you can call abort() on that XHR object. beforeSend is not an option listed in the jQuery Form options list, but it is an option to $.ajax(), and ajaxSubmit()/ajaxForm() take any option that $.ajax() does. So there is a way to abort the upload, though I think it would be nice if it were better documented than it is now - or if there were a convenient utility function to abort, as you suggested. I was stuck on this for a little while myself, because I initially expected ajaxSubmit()/ajaxForm() to return the XHR object, and I was mainly only looking at the jQuery Form options list instead of the $.ajax() options list. I only found the answer from this issue. |
I do not know, it seems to us more appropriate and logical way return XHR object, like it has with jQuery $.ajax |
I would prefer the xhr object returned. Especially seeing as this plug-in is unlikely to be used with chaining. |
The jqHXR is now stored on the form object and is accessible using the
|
Please add ajaxAbort() method or return in your methods ajaxSubmit and ajaxForm XHR object, please. The library does not abort the request.
The text was updated successfully, but these errors were encountered: