X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fxhr.js;h=4896e6cb6fb00c00c3d5c6f97aadfaa8c400aed7;hb=948c0dfffcf077ed71e4712b38a33d06ea63264c;hp=66be46362b84a1e8d03b3b2e39ed3ccba3d65c04;hpb=a500d33c5d63aa22f024472b2cc8c15c624a342e;p=jquery.git diff --git a/src/xhr.js b/src/xhr.js index 66be463..4896e6c 100644 --- a/src/xhr.js +++ b/src/xhr.js @@ -1,6 +1,6 @@ (function( jQuery ) { -var rquery = /\?/, +var rquery_xhr = /\?/, rhash = /#.*$/, rheaders = /^(.*?):\s*(.*?)\r?$/mg, // IE leaves an \r character at EOL rnoContent = /^(?:GET|HEAD)$/, @@ -87,7 +87,7 @@ jQuery.xhr = function( _native ) { } // Apply option prefilters - for (i in prefilters) { + for ( i = 0; i < prefilters.length; i++ ) { prefilters[i](s); } @@ -109,7 +109,7 @@ jQuery.xhr = function( _native ) { // If data is available, append data to url if ( data ) { - url += (rquery.test(url) ? "&" : "?") + data; + url += (rquery_xhr.test(url) ? "&" : "?") + data; } // Add anti-cache in url if needed @@ -120,7 +120,7 @@ jQuery.xhr = function( _native ) { ret = url.replace(rts, "$1_=" + ts ); // if nothing was replaced, add timestamp to the end - url = ret + ((ret == url) ? (rquery.test(url) ? "&" : "?") + "_=" + ts : ""); + url = ret + ((ret == url) ? (rquery_xhr.test(url) ? "&" : "?") + "_=" + ts : ""); } s.url = url; @@ -597,23 +597,6 @@ jQuery.xhr = function( _native ) { reset(1); // Install callbacks related methods - jQuery.each(["bind","unbind"], function(_, name) { - xhr[name] = function(type) { - - var functors = sliceFunc.call(arguments,1), - list; - - jQuery.each(type.split(/\s+/g), function() { - list = callbacksLists[this]; - if ( list ) { - list[name].apply(list, functors ); - } - }); - - return this; - }; - }); - jQuery.each(callbacksLists, function(name) { var list; xhr[name] = function() {