Skip to content

support for xhr.status + correctly trigger ajaxError handlers #72

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

Merged
merged 6 commits into from
May 23, 2011
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
1.5 compatibility - $.httpSuccess was removed
  • Loading branch information
kares committed Apr 28, 2011
commit 9df439a52a16250ab1f90fd63618bb1985db154c
4 changes: 3 additions & 1 deletion jquery.form.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,9 @@ $.fn.ajaxSubmit = function(options) {
}

if (typeof(xhr.status) === 'number') { // we've set xhr.status
status = $.httpSuccess( xhr ) ? 'success' : 'error';
// jQuery.httpSuccess available in 1.4 but removed from 1.5
// IE sometimes returns 1223 when it should be 204 so treat it as success, see #1450
status = xhr.status >= 200 && xhr.status < 300 || xhr.status === 304 || xhr.status === 1223 ? 'success' : 'error';
}

// ordering of these callbacks/triggers is odd, but that's how $.ajax does it
Expand Down