var jQuery = function(selector, context){ return new jQuery.fn.init(selector, context); }; jQuery.fn = jQuery.prototype = { constructor: jQuery, init: function() { return this; } }; jQuery.fn.init.prototype = jQuery.fn; jQuery(‘p‘);
jQuery源码分析(2) - 为什么不用new jQuery而是用$()
原文:https://www.cnblogs.com/easonw/p/11505254.html