代碼如下: /* prevent execution of jQuery if included more then once */ if(typeof window.jQuery == "undefined") { /* * jQuery 1.0.4 - New Wave Javascript * * Copyright (c) 2006 John Resig (jquery.com) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * $Date: 2006-12-12 15:33:10 -0500 (Tue, 12 Dec 2006) $ * $Rev: 696 $ */
// Global undefined variable window.undefined = window.undefined;
var jQuery = function(a,c) {
// Shortcut for document ready if ( a && typeof a == "function" && jQuery.fn.ready && !a.nodeType && a[0] == undefined ) // Safari reports typeof on DOM NodeLists as a function return jQuery(document).ready(a);
// Make sure that a selection was provided a = a || document;
// Watch for when a jQuery object is passed as the selector if ( a.jquery ) return jQuery( jQuery.merge( a, [] ) );
// Watch for when a jQuery object is passed at the context if ( c && c.jquery ) return jQuery( c ).find(a);
// If the context is global, return a new object if ( window == this ) return new jQuery(a,c);
// Handle HTML strings if ( typeof a == "string" ) { var m = /^[^<]*(<.+>)[^>]*$/.exec(a); if ( m ) a = jQuery.clean( [ m[1] ] ); }
// Watch for when an array is passed in this.set( a.constructor == Array || a.length && a != window && !a.nodeType && a[0] != undefined && a[0].nodeType ?