git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5fd21fc
)
Fix for #7865. Scripts onload handler passes event as first parameter so statusText...
author
jaubourg
<j@ubourg.net>
Thu, 30 Dec 2010 03:41:52 +0000
(
04:41
+0100)
committer
jaubourg
<j@ubourg.net>
Thu, 30 Dec 2010 03:41:52 +0000
(
04:41
+0100)
src/transports/script.js
patch
|
blob
|
history
diff --git
a/src/transports/script.js
b/src/transports/script.js
index
fe38735
..
7416a2d
100644
(file)
--- a/
src/transports/script.js
+++ b/
src/transports/script.js
@@
-47,10
+47,9
@@
jQuery.xhr.bindTransport("script", function(s) {
script.src = s.url;
// Attach handlers for all browsers
script.src = s.url;
// Attach handlers for all browsers
- script.onload = script.onreadystatechange = function(statusText) {
+ script.onload = script.onreadystatechange = function( _ , statusText) {
- if ( (!script.readyState ||
- script.readyState === "loaded" || script.readyState === "complete") ) {
+ if ( ! script.readyState || /loaded|complete/.test( script.readyState ) ) {
// Handle memory leak in IE
script.onload = script.onreadystatechange = null;
// Handle memory leak in IE
script.onload = script.onreadystatechange = null;
@@
-60,10
+59,10
@@
jQuery.xhr.bindTransport("script", function(s) {
head.removeChild( script );
}
head.removeChild( script );
}
- script = undefined;
+ script = 0;
- // Callback & dereference
- callback(statusText ? 0 : 200, statusText || "success");
+ // Callback
+ 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.xhr.bindTransport("script", function(s) {
abort: function(statusText) {
if ( script ) {
abort: function(statusText) {
if ( script ) {
- script.onload(statusText);
+ script.onload( 0 , statusText );
}
}
};
}
}
};