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
ajaxSubmit does not expose nor return handle to ajax promise #234
Comments
Made a quick change to allow access to the jqxhr. The plugin will now add a property to the settings object called 'jqxhr' and that will be available in callbacks, like beforeSend. I can't change the return type on that method because it is and always has been a plugin method that returns a jQuery object. This change isn't ideal, I know. |
Could you give an example usage to access it with your above changeset? What about another jquery.fn like |
jqxhr object is now stored in element data. Example: http://jquery.malsup.com/form/deferred.php |
We are using ajaxSubmit in our projects and since we are migrating to new standard Javascript and good practises, is a pity this cant be implemented :(. If someone has a nice and clean workaround we are here to listen :) |
http://api.jquery.com/jQuery.ajax/#jqXHR
So in normal jquery code you can do
Promises are very powerful and jQuery has adopted them as their core async flow control. An async jQuery form plugin that mimics the ajax method seems like it should return one or a way to get it. From browsing the code I don't see any exposed ajax objects.
Since
ajaxSubmit
takes the same arguments as$.ajax
so it seems very logical that it would return a promise object instead of the form element, or expose a way to get it.$form.ajaxSubmit().promise()
does not work since it's only grabbing the form element's deferred object.The text was updated successfully, but these errors were encountered: