(function( window, undefined ) {
var jQuery = function( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced'
return new jQuery.fn.init( selector, context, rootjQuery );
};
window.jQuery = window.$ = jQuery;
})( window );
--
和以下语法相等等。
<script>
var startJquery =function ( window, undefined ) {
var jQuery = function( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced'
return new jQuery.fn.init( selector, context, rootjQuery );
};
window.jQuery = window.$ = jQuery;
};
startJquery(window);
</script>