Skip to main content

Bug Tracker

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.

Attachments (2)
  • 1774.diff (0.5 KB) - added by davidserduke October 04, 2007 06:00PM UTC.
  • noConflict.htm (0.7 KB) - added by scottgonzalez October 04, 2007 04:33PM UTC.
Change History (3)

Changed October 04, 2007 06:07PM UTC by davidserduke comment:1

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.

Changed October 08, 2007 06:23PM UTC by john comment:2

owner: → john

Changed October 20, 2007 10:05PM UTC by john comment:3

resolution: → fixed
status: newclosed

Fixed in SVN rev [3701].