0
jQuery是通过暴露:什么jQuery被暴露?
// Expose jQuery to the global object
window.jQuery = window.$ = jQuery;
但有两个jQuery的:
var jQuery = (function() {
// Define a local copy of jQuery
var jQuery = function(selector, context) {
// The jQuery object is actually just the init constructor 'enhanced'
return new jQuery.fn.init(selector, context, rootjQuery);
},
据我所知,这是合法的名字 - 他们来自不同的范围是。 但是哪一个暴露了? 我想这是var jQuery = function(selector, context)
但似乎在不同的范围是从window.jQuery = window.$ = jQuery;
谢谢!这就说得通了!我实际上是看着http://code.jquery.com/jquery-1.6.4.js – DrStrangeLove