return this.length;
},
- toArray: function(){
+ toArray: function() {
return slice.call( this, 0 );
},
},
map: function( callback ) {
- return this.pushStack( jQuery.map(this, function(elem, i){
+ return this.pushStack( jQuery.map(this, function( elem, i ) {
return callback.call( elem, i, elem );
}));
},
},
bindReady: function() {
- if ( readyBound ) { return; }
+ if ( readyBound ) {
+ return;
+ }
+
readyBound = true;
// Catch cases where $(document).ready() is called after the
try {
toplevel = window.frameElement == null;
- } catch(e){}
+ } catch(e) {}
if ( document.documentElement.doScroll && toplevel ) {
doScrollCheck();
// Must be an Object.
// Because of IE, we also have to check the presence of the constructor property.
// Make sure that DOM nodes and window objects don't pass through, as well
- if ( !obj || toString.call(obj) !== "[object Object]" || !("constructor" in obj) || obj.nodeType || obj.setInterval ) {
+ if ( !obj || toString.call(obj) !== "[object Object]" || obj.nodeType || obj.setInterval ) {
return false;
}
return ret.concat.apply( [], ret );
},
+ // A global GUID counter for objects
+ guid: 1,
+
+ proxy: function( fn, proxy, thisObject ) {
+ if ( arguments.length === 2 && proxy && !jQuery.isFunction( proxy ) ) {
+ thisObject = proxy;
+ proxy = undefined;
+ }
+
+ proxy = proxy || function() {
+ return fn.apply( thisObject || this, arguments );
+ };
+
+ // Set the guid of unique handler to the same of original handler, so it can be removed
+ proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
+
+ // So proxy can be declared as an argument
+ return proxy;
+ },
+
// Use of jQuery.browser is frowned upon.
// More details: http://docs.jquery.com/Utilities/jQuery.browser
browser: {
- version: (/.*?(?:firefox|safari|opera|msie)[\/ ]([\d.]+)/.exec(userAgent) || [0,'0'])[1],
+ version: (/.*?(?:firefox|safari|opera|msie)[\/ ]([\d.]+)/.exec(userAgent) || [0,"0"])[1],
safari: /safari/.test( userAgent ),
opera: /opera/.test( userAgent ),
msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),