Bug Tracker

Opened 13 years ago

Closed 13 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)

noConflict.htm (705 bytes) - added by scottgonzalez 13 years ago.
1774.diff (479 bytes) - added by davidserduke 13 years ago.

Download all attachments as: .zip

Change History (5)

Changed 13 years ago by scottgonzalez

Attachment: noConflict.htm added

Changed 13 years ago by davidserduke

Attachment: 1774.diff added

comment:1 Changed 13 years ago by davidserduke

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.

comment:2 Changed 13 years ago by john

Owner: set to john

comment:3 Changed 13 years ago by john

Resolution: fixed
Status: newclosed

Fixed in SVN rev [3701].

Note: See TracTickets for help on using tickets.