aboutsummaryrefslogtreecommitdiffstats
path: root/src/ajax.js
diff options
context:
space:
mode:
authorjeresig <jeresig@gmail.com>2009-12-31 09:50:49 -0500
committerjeresig <jeresig@gmail.com>2009-12-31 09:50:49 -0500
commit6cb2945837ccca55204191a8e7a70b2b2486c28e (patch)
tree84c70783906dd9c784fbf96f815e88900b287077 /src/ajax.js
parentfe6c86d53046b0f4d648f61c0b8e75387af65152 (diff)
downloadjquery-6cb2945837ccca55204191a8e7a70b2b2486c28e.tar.gz
jquery-6cb2945837ccca55204191a8e7a70b2b2486c28e.zip
Rather than declaring empty anonymous functions all around, introduce and use a single empty function. Thanks to Matt Kruse for the suggestion.
Diffstat (limited to 'src/ajax.js')
-rw-r--r--src/ajax.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ajax.js b/src/ajax.js
index 2249dc687..37fb75b55 100644
--- a/src/ajax.js
+++ b/src/ajax.js
@@ -384,7 +384,7 @@ jQuery.extend({
// The request was aborted, clear the interval and decrement jQuery.active
if ( !xhr || xhr.readyState === 0 ) {
requestDone = true;
- xhr.onreadystatechange = function(){};
+ xhr.onreadystatechange = jQuery.noop;
// Handle the global AJAX counter
if ( s.global && ! --jQuery.active ) {
@@ -394,7 +394,7 @@ jQuery.extend({
// The transfer is complete and the data is available, or the request timed out
} else if ( !requestDone && xhr && (xhr.readyState === 4 || isTimeout === "timeout") ) {
requestDone = true;
- xhr.onreadystatechange = function(){};
+ xhr.onreadystatechange = jQuery.noop;
status = isTimeout === "timeout" ?
"timeout" :