Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AurelioDeRosa
Copy link
Member

Fixes gh-904

$.when( $.ajax( "test.aspx" ), $.ajax( "page.aspx" ) ).then(function( res1, res2 ) {
alert( res1[2].status ); // Alerts 200
})
.fail(function( err1, err2 ) {
Copy link
Member

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").

Copy link
Member

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
Copy link
Member

mgol commented Mar 22, 2017

@AurelioDeRosa This PR is pretty old; will you be able to apply updates based on feedback?

@AurelioDeRosa
Copy link
Member Author

Is this PR still relevant or should I just close it?

@mgol
Copy link
Member

mgol commented Feb 10, 2018

@AurelioDeRosa Since you opened this PR the jQuery.when page got only one small update in commit 3ab6720. So I think it's still very much relevant (and rebasing over current master shouldn't be hard).

@mgol
Copy link
Member

mgol commented Aug 1, 2018

@AurelioDeRosa what's the state of the PR? Will you have time to finish it?

Base automatically changed from master to main February 1, 2021 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

7 participants