Side navigation
#1774 closed bug (fixed)
Opened October 04, 2007 04:31PM UTC
Closed October 20, 2007 10:05PM UTC
jQuery.noConflict(true) does not revert jQuery variable
Reported by: | scottgonzalez | Owned by: | john |
---|---|---|---|
Priority: | major | Milestone: | 1.2.2 |
Component: | core | Version: | 1.2.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
jQuery.noConflict(true) properly reverts $, but not jQuery.
The problem is solved by adding window.jQuery to the initial test and assignment at the top of the jquery.js file. The issue came about because the anonymous function module that surrounds the jquery code was allowing the
var jQuery = ..
that was later in the file to define a local version of jQuery. So the initial test
if (typeof jQuery != 'undefined')
was failing since it was using the local scope and it really was undefined so far. Adding the global for both instances solved the problem.
One thing to note from the test case is jQuery.noConflict() returns the "new" jQuery, not the old one.