Added a fix for .noConflict(true) not reverting properly. Also added unit tests for noConflict.

This commit is contained in:
John Resig 2007-10-20 22:04:06 +00:00
parent 5736e8d90d
commit 1ac9d6fbee
3 changed files with 26 additions and 4 deletions

View file

@ -10,8 +10,8 @@
*/
// Map over jQuery in case of overwrite
if ( typeof jQuery != "undefined" )
var _jQuery = jQuery;
if ( window.jQuery )
var _jQuery = window.jQuery;
var jQuery = window.jQuery = function( selector, context ) {
// If the context is a namespace object, return a new object
@ -21,8 +21,8 @@ var jQuery = window.jQuery = function( selector, context ) {
};
// Map over the $ in case of overwrite
if ( typeof $ != "undefined" )
var _$ = $;
if ( window.$ )
var _$ = window.$;
// Map the jQuery namespace to the '$' one
window.$ = jQuery;