- Notifications
You must be signed in to change notification settings - Fork262
jQuery.when: Improved example#915
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| $.when( $.ajax( "test.aspx" ), $.ajax( "page.aspx" ) ).then(function( res1, res2 ) { | ||
| alert( res1[2].status ); // Alerts 200 | ||
| }) | ||
| .fail(function( err1, err2 ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Should we switch to.catch() here@gibson042? Also since the failure occurs as soon as any rejection occurs, I think it's possible thatres1 does not yet have a status ifres2 rejected. If a programming exception occurred they might even beError objects instead ofjQXHR objects! In real code you'd need to inspect both to sort it out.
Perhaps for the purposes of this example we could justalert("one or more requests failed").
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Your instincts are good,@dmethvin. I agree on all counts.
mgol commentedMar 22, 2017
@AurelioDeRosa This PR is pretty old; will you be able to apply updates based on feedback? |
AurelioDeRosa commentedFeb 10, 2018
Is this PR still relevant or should I just close it? |
mgol commentedFeb 10, 2018
@AurelioDeRosa Since you opened this PR the |
mgol commentedAug 1, 2018
@AurelioDeRosa what's the state of the PR? Will you have time to finish it? |
Fixesgh-904