Bug Tracker

Opened 13 years ago

Closed 12 years ago

Last modified 11 years ago

#6575 closed bug (fixed)

jQuery 1.4.2 conflicts with other libraries even using .noConflict() in IE and Opera

Reported by: phuc.quang Owned by:
Priority: Milestone: 1.4.3
Component: offset Version: 1.4.2
Keywords: Cc:
Blocked by: Blocking:


jQuery 1.4.2 conflicts with Prototype and Mootools even using noConflict() mode in IE (tested with IE7/IE8), and Opera (tested with 10.53). It doesn't happen with jQuery 1.3.2.

Attachments (1)

index68.html (680 bytes) - added by phuc.quang 13 years ago.

Download all attachments as: .zip

Change History (7)

Changed 13 years ago by phuc.quang

Attachment: index68.html added

comment:1 Changed 13 years ago by phuc.quang

Debugging further, I found:

Line 6213, return ("scrollTo" in elem && elem.document) ? does it walk and quack like a window?

Since the page is also having PrototypeJS, it's add "scrollTo" method to the object. So, "scrollTo" in elem is true.

About elem.document, in Opera/IE, there is always .document property for elements. So, elem.document is true.

Because of that, ("scrollTo" in elem && elem.document) will be true if there is a PrototypeJS/Mootools in Opera/IE and it will return the document size instead of element size.

comment:2 Changed 13 years ago by dmethvin

How is jQuery conflicting here? The other libraries are changing builtin objects, interfering with jQuery. To avoid the conflict, jQuery would need to find a property that we can assure won't be added by those libraries.

comment:3 Changed 13 years ago by Flo

Is there a good solution ? http://dev.jqueryui.com/ticket/5438

comment:4 Changed 13 years ago by niQo

We have the same problem using noConflict() jquery 1.4.2 and protoype 1.6.1 with IE 7 / 8.

This workaround seems to work : http://dev.jqueryui.com/ticket/5438

comment:5 Changed 12 years ago by phildriscoll

I have attached a couple of patches in comment 3 at http://dev.jqueryui.com/ticket/5438#comment:3

These patch dimensions.js and offset.js in the jQuery source and solve this problem.

comment:6 Changed 12 years ago by john

Component: coreoffset
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.