
jQuery原理(原型)
(function(){ var jQuery = window.jQuery = window.$ = function( selector, context ) { return new jQuery.fn.init( selector, context); }; jQuery.fn = jQuery.prototype = { init:function(selector, context){ alert(selector); }, add : function() { return this; } } jQuery.fn.init.prototype = jQuery.fn; })(); //$("dd").add();