Opened 15 years ago
Closed 15 years ago
#1774 closed bug (fixed)
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.
Attachments (2)
Change History (5)
Changed 15 years ago by
Attachment: | noConflict.htm added |
---|
Changed 15 years ago by
comment:1 Changed 15 years ago by
comment:2 Changed 15 years ago by
Owner: | set to john |
---|
Note: See
TracTickets for help on using
tickets.
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.