mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Ajax: Don't let onreadystatechange preempt exceptions from xhr.send
Ref 0a6e1c4b19
This commit is contained in:
parent
3680689165
commit
b5c6fc7ebb
@ -174,8 +174,12 @@ if ( xhrSupported ) {
|
||||
callback();
|
||||
} else {
|
||||
|
||||
// Add to the list of active xhr callbacks
|
||||
xhr.onreadystatechange = callback;
|
||||
// Register the callback, but delay it in case `xhr.send` throws
|
||||
xhr.onreadystatechange = function() {
|
||||
if ( callback ) {
|
||||
window.setTimeout( callback );
|
||||
}
|
||||
};
|
||||
|
||||
xhr.send( ( options.hasContent && options.data ) || null );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user