-
Notifications
You must be signed in to change notification settings - Fork 264
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
Arguments accessible by .always(), .done() and .fail() from jQuery.ajax() #594
Comments
I agree that the ajax docs are long, due to the complexity of the API. How would you suggest editing the page? Can you provide a pull request? |
@dmethvin : Fixing the ajax docs isn't as important here as fixing the deferred.done/fail/always docs. We need to include params for callback functions, which we're already sort of doing in $.ajax, but not in the others. |
👍 |
2 similar comments
👍 |
+1 |
This ticket seems to be a magnet for people providing guidance-free support for .... something. Can one of you offer a pull request or post here a specific set of changes you'd like to see? |
From the original opening post "The docs for done(), always() etc.. should describe the params for the function." |
Great, then from my reply to the opening post, if you have ideas then please do file a pull request. There are 45 people watching this repo, including me, and it is nicer to them if a notification includes more than a thumbs-up or plus-one. |
Both myself and kswedberg have indicated what is missing from the documentation. It's hard to write the docs when you don't know what the values are. |
I'm still not sure what you're asking for. The current docs say
Those are the same arguments in the same order as the |
@dmethvin, The problem is that someone using |
As far as I'm concerned, the current doc is fine now (as @dmethvin points out). It wasn't at the time it was opened. I believe this issue is now resolved. 😄 |
@marcandre - where on this page does it mention what the parameters are for the callback functions you pass to done()? https://api.jquery.com/deferred.done/ Answer: It doesn't, but should. |
The docs already say how it works:
The parameters that are passed to a If the problem is that people are arriving at the |
@dmethvin : Agreed. that seems like the most sensible course of action here. |
This seems kind of important to document, yet it's been a known issue since ... mid 2012? Please add the function's arguments to the docs, or at least a reference to the fact that the function has arguments? I'm not sure how the information can be considered complete and accurate without at least that reference. |
Hi @deesto. The team is focused on keeping the documentation as accurate and correct as possible. However, as you might know, we work on this in our spare time. Therefore, we always encourage and appreciate any PR that can help us. Would you be keen to submit a PR for this issue? |
I'd like to mention additional caveat for the done() function that should be documented. If you supply only 1 deferred This drove me nuts when I had variable number of deferred ajax calls (1 or more). |
@dimkanewtown That is already documented, see the note on the page: http://api.jquery.com/deferred.always/ |
I have hard time translating what is written there into these two cases: Single $.ajax() call.
vs multiple $.ajax() calls
Where args[] is a multidimensional array
|
The docs for |
You're right, $.when documentation describes it to the "t". Was expecting (maybe wrongly) the explanation under done() though. Thanks for the reference. |
So it seems all the information is there, but not necessarily where people are expecting it. I think what we need is someone to rethink the organization and redo it so that parameter info is obvious, or at least easy to get to, no matter which page you're on. Unfortunately I don't have the depth of knowledge in this area to make the PR myself. |
Relates to: #49
The documentation is still badly formed. The docs for done(), always() etc.. should describe the params for the function. The page for .ajax is already long winded and I missed the snippet that was reproduced in alano999's post in the above issue.
The text was updated successfully, but these errors were encountered: