Merge branch 'master' of github.com:jquery/jquery into deferred
This commit is contained in:
commit
64902e0345
|
@ -47,10 +47,9 @@ jQuery.ajax.transport("script", function(s) {
|
||||||
script.src = s.url;
|
script.src = s.url;
|
||||||
|
|
||||||
// Attach handlers for all browsers
|
// Attach handlers for all browsers
|
||||||
script.onload = script.onreadystatechange = function(statusText) {
|
script.onload = script.onreadystatechange = function( _ , statusText) {
|
||||||
|
|
||||||
if ( (!script.readyState ||
|
if ( ! script.readyState || /loaded|complete/.test( script.readyState ) ) {
|
||||||
script.readyState === "loaded" || script.readyState === "complete") ) {
|
|
||||||
|
|
||||||
// Handle memory leak in IE
|
// Handle memory leak in IE
|
||||||
script.onload = script.onreadystatechange = null;
|
script.onload = script.onreadystatechange = null;
|
||||||
|
@ -60,10 +59,10 @@ jQuery.ajax.transport("script", function(s) {
|
||||||
head.removeChild( script );
|
head.removeChild( script );
|
||||||
}
|
}
|
||||||
|
|
||||||
script = undefined;
|
script = 0;
|
||||||
|
|
||||||
// Callback & dereference
|
// Callback
|
||||||
callback(statusText ? 0 : 200, statusText || "success");
|
callback( statusText ? 0 : 200, statusText || "success" );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// Use insertBefore instead of appendChild to circumvent an IE6 bug.
|
// Use insertBefore instead of appendChild to circumvent an IE6 bug.
|
||||||
|
@ -73,7 +72,7 @@ jQuery.ajax.transport("script", function(s) {
|
||||||
|
|
||||||
abort: function(statusText) {
|
abort: function(statusText) {
|
||||||
if ( script ) {
|
if ( script ) {
|
||||||
script.onload(statusText);
|
script.onload( 0 , statusText );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue