-
$.extend
extend function is used to extend jQuery object. We can use it to do extend normal object, jQuery utility and jQuery method.
-
$(fn)
In jQuery, $(fn) is a short cut to $.fn.ready(fn). First you call the $.fn.ready(fn), in the function it call jQuery.bindReady() first, then add the fn to a readyList. In the jQuery.bindReady() function, it try to hookup DOMContentLoaded handler, in IE the event is called onreadystatechange. In the DOMContentLoaded handler, it call the jQuery.ready() function, in side of this function, the function in the readyList is invoked
-
jQuery is an array like object
In javascript, array is object, so there are lots benefit to use array object, like the length, index, slice. jQuery is a collection of element, so use it as an array is very convenient. it seems to me that jQuery object can not use array as prototype for some reason, so how we can use an object like an array, please read the following code.
var x = {}; x[0] = "zero"; x[1] = "one" -
arguments.callee
var sum = function(i) { if (i == 1) { return i; } else { return i + arguments.callee(i-1); } } alert(sum(3)); -
makeArray function
function highest(){ //return arguments.slice(1).sort(function(a,b){ return makeArray(arguments).sort(function(a,b){ return b - a; }); } function makeArray(array){ return [].slice.call( array ); }