X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fjquery%2Fjquery.js;h=f942bf4f6fceb3d6f6d3d8a59c2407e50349d6dd;hb=fd30d7746d1b98b362f796f235805061d63d514f;hp=46019bf94694782a4fa4f8fbac9b1d9169c511eb;hpb=75b6bcdb4206fc8cb0bd4294bdc9fef87c44325d;p=jquery.git diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index 46019bf..f942bf4 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -154,10 +154,18 @@ var $ = jQuery; * }); * @desc Executes the function when the DOM is ready to be used. * + * @example jQuery(function($) { + * // Your code using failsafe $ alias here... + * }); + * @desc Uses both the shortcut for $(document).ready() and the argument + * to write failsafe jQuery code using the $ alias, without relying on the + * global alias. + * * @name $ * @param Function fn The function to execute when the DOM is ready. * @cat Core * @type jQuery + * @see ready(Function) */ jQuery.fn = jQuery.prototype = { @@ -540,7 +548,7 @@ jQuery.fn = jQuery.prototype = { "textContent" : "innerText"; return e == undefined ? - this.length && this[0][ type ] : + jQuery.map(this, function(a){ return a[ type ]; }).join('') : this.each(function(){ this[ type ] = e; }); }, @@ -805,6 +813,7 @@ jQuery.fn = jQuery.prototype = { * * @name clone * @type jQuery + * @param Boolean deep (Optional) Set to false if you don't want to clone all descendant nodes, in addition to the element itself. * @cat DOM/Manipulation */ clone: function(deep) { @@ -1245,7 +1254,7 @@ jQuery.extend({ prop: function(elem, value, type){ // Handle executable functions if ( value.constructor == Function ) - return value.call( elem ) + return value.call( elem ); // Handle passing in a number to a CSS property if ( value.constructor == Number && type == "css" ) @@ -1374,7 +1383,7 @@ jQuery.extend({ clean: function(a) { var r = []; - + for ( var i = 0, al = a.length; i < al; i++ ) { var arg = a[i]; @@ -1427,7 +1436,7 @@ jQuery.extend({ arg = div.childNodes; } - if ( arg.nodeType ) + if ( arg[0] == undefined ) r.push( arg ); else r = jQuery.merge( r, arg );