// HANDLE: $(function)
// Shortcut for document ready
// Safari reports typeof on DOM NodeLists as a function
- if ( typeof a == "function" && !a.nodeType && a[0] == undefined )
+ if ( isFunction(a) && !a.nodeType && a[0] == undefined )
return new jQuery(document)[ jQuery.fn.ready ? "ready" : "load" ]( a );
// Handle HTML strings
*/
filter: function(t) {
return this.pushStack(
- t.constructor == Function &&
+ isFunction( t.constructor ) &&
jQuery.grep(this, function(el, index){
return t.apply(el, [index])
}) ||
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;
}) );
$ = jQuery._$;
},
+ isFunction: function( fn ) {
+ return fn && typeof fn == "function";
+ },
+
/**
* A generic iterator function, which can be used to seemlessly
* iterate over both objects and arrays. This function is not the same
prop: function(elem, value, type){
// Handle executable functions
- if ( value.constructor == Function )
+ if ( isFunction( value ) )
return value.call( elem );
// Handle passing in a number to a CSS property
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" ) {
*/
/*
- * Wheather the W3C compliant box model is being used.
+ * Whether the W3C compliant box model is being used.
*
* @property
* @name $.boxModel