* });
* @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 = {
"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; });
},
*
* @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) {
jQuery.grep(this,function(a){
if ( t.constructor == Array || t.jquery )
- return !jQuery.inArray( t, a );
+ return jQuery.inArray( t, a ) < 0;
else
return a != t;
}) );
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" )
clean: function(a) {
var r = [];
-
+
for ( var i = 0, al = a.length; i < al; i++ ) {
var arg = a[i];
+
+ if ( !arg ) continue;
+
+ if ( arg.constructor == Number )
+ arg = arg.toString();
// Convert html string into DOM nodes
if ( typeof arg == "string" ) {
arg = div.childNodes;
}
- if ( arg.nodeType )
+ if ( arg[0] == undefined )
r.push( arg );
else
r = jQuery.merge( r, arg );
*/
/*
- * Wheather the W3C compliant box model is being used.
+ * Whether the W3C compliant box model is being used.
*
* @property
* @name $.boxModel