jQuery
ラッパー コードを使用する基本的なスクリプトがあり、転送されたグローバルwindow
パラメータで初期化されます。このパラメータを転送する必要がありますか? window
はグローバルパラメーターであり、転送するかどうかにかかわらず、関数内から使用できます。
その理由は何ですか?
(function (window, undefined) {
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);
},
//some code
//...
//...
//...
window.jQuery = window.$ = jQuery;
})(window);