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();
|
callback();
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Add to the list of active xhr callbacks
|
// Register the callback, but delay it in case `xhr.send` throws
|
||||||
xhr.onreadystatechange = callback;
|
xhr.onreadystatechange = function() {
|
||||||
|
if ( callback ) {
|
||||||
|
window.setTimeout( callback );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
xhr.send( ( options.hasContent && options.data ) || null );
|
xhr.send( ( options.hasContent && options.data ) || null );
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user