Opened 14 years ago

Closed 13 years ago

#4704 closed bug (fixed)

Datepicker global variable isn't unique

Reported by: obrie Owned by:
Priority: critical Milestone: 1.8
Component: ui.datepicker Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:


One of the nice things with jQuery is that it shouldn't conflict with anything else on the page, even another jQuery installation. In the Datepicker widget, a global variable is added (DP_jQuery) that will cause problems if there is more than one install of jQuery on the page.

While this may be an edge case, it affects my particular usage because we have a library which uses jQuery UI that gets distributed on many websites, any of which may have their own version of jQuery / jQuery UI installed. As a result, we need to make sure that our library (and so, jQuery and jQuery UI) introduce no conflicts with anything else on the page.

Since DP_jQuery would conflict with another installation of jQuery UI, it should be at least a unique variable such that the two can coexist. This patch uses Datepicker's uuid to generate a unique global variable which is then referenced through the rest of the plugin.

Ideally, there shouldn't be a need for a global variable at all. However, this preserves jQuery's non-conflicting nature.

Attachments (1)

noconflict.diff (6.1 KB) - added by obrie 14 years ago.
Non-conflicting ui.datepicker (fixed when using multiple instances)

Download all attachments as: .zip

Change History (3)

Changed 14 years ago by obrie

Attachment: noconflict.diff added

Non-conflicting ui.datepicker (fixed when using multiple instances)

comment:1 Changed 14 years ago by Scott González

Milestone: TBD1.8
Priority: minorcritical

comment:2 Changed 13 years ago by kbwood

Resolution: fixed
Status: newclosed

Fixed in r3486.

Note: See TracTickets for help on using tickets.