git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Simplified the structure of the .css() and .attr() methods (reducing the number of...
[jquery.git]
/
src
/
ajax.js
diff --git
a/src/ajax.js
b/src/ajax.js
index
9e30eef
..
0f5f805
100644
(file)
--- a/
src/ajax.js
+++ b/
src/ajax.js
@@
-71,7
+71,7
@@
jQuery.fn.extend({
.filter(function(){
return this.name && !this.disabled &&
(this.checked || /select|textarea/i.test(this.nodeName) ||
.filter(function(){
return this.name && !this.disabled &&
(this.checked || /select|textarea/i.test(this.nodeName) ||
- /text|hidden|password/i.test(this.type));
+ /text|hidden|password|search/i.test(this.type));
})
.map(function(i, elem){
var val = jQuery(this).val();
})
.map(function(i, elem){
var val = jQuery(this).val();
@@
-267,6
+267,9
@@
jQuery.extend({
done = true;
success();
complete();
done = true;
success();
complete();
+
+ // Handle memory leak in IE
+ script.onload = script.onreadystatechange = null;
head.removeChild( script );
}
};
head.removeChild( script );
}
};
@@
-380,6
+383,9
@@
jQuery.extend({
// Fire the complete handlers
complete();
// Fire the complete handlers
complete();
+ if ( isTimeout )
+ xhr.abort();
+
// Stop memory leaks
if ( s.async )
xhr = null;
// Stop memory leaks
if ( s.async )
xhr = null;
@@
-394,14
+400,8
@@
jQuery.extend({
if ( s.timeout > 0 )
setTimeout(function(){
// Check to see if the request is still happening
if ( s.timeout > 0 )
setTimeout(function(){
// Check to see if the request is still happening
- if ( xhr ) {
- if( !requestDone )
- onreadystatechange( "timeout" );
-
- // Cancel the request
- if ( xhr )
- xhr.abort();
- }
+ if ( xhr && !requestDone )
+ onreadystatechange( "timeout" );
}, s.timeout);
}
}, s.timeout);
}