Added a change that triples the speed of all uses of $(...). For example $(DOMElement) was 38ms, is now 13ms.
This commit is contained in:
parent
ccf055033a
commit
f97f77c034
|
@ -14,10 +14,8 @@ if ( window.jQuery )
|
||||||
var _jQuery = window.jQuery;
|
var _jQuery = window.jQuery;
|
||||||
|
|
||||||
var jQuery = window.jQuery = function( selector, context ) {
|
var jQuery = window.jQuery = function( selector, context ) {
|
||||||
// If the context is a namespace object, return a new object
|
// The jQuery object is actually just the init constructor 'enhanced'
|
||||||
return this instanceof jQuery ?
|
return new jQuery.prototype.init( selector, context );
|
||||||
this.init( selector, context ) :
|
|
||||||
new jQuery( selector, context );
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Map over the $ in case of overwrite
|
// Map over the $ in case of overwrite
|
||||||
|
@ -521,6 +519,9 @@ jQuery.fn = jQuery.prototype = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Give the init function the jQuery prototype for later instantiation
|
||||||
|
jQuery.prototype.init.prototype = jQuery.prototype;
|
||||||
|
|
||||||
function evalScript( i, elem ) {
|
function evalScript( i, elem ) {
|
||||||
if ( elem.src )
|
if ( elem.src )
|
||||||
jQuery.ajax({
|
jQuery.ajax({
|
||||||
|
|
Loading…
Reference in a new issue