-
Notifications
You must be signed in to change notification settings - Fork 266
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
jQuery.when: Improved example #915
base: main
Are you sure you want to change the base?
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 that res1
does not yet have a status if res2
rejected. If a programming exception occurred they might even be Error
objects instead of jQXHR
objects! In real code you'd need to inspect both to sort it out.
Perhaps for the purposes of this example we could just alert("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.
@AurelioDeRosa This PR is pretty old; will you be able to apply updates based on feedback? |
Is this PR still relevant or should I just close it? |
@AurelioDeRosa Since you opened this PR the |
@AurelioDeRosa what's the state of the PR? Will you have time to finish it? |
Fixes gh-904