#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: |
Description
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)
Change History (7)
Changed 13 years ago by
Attachment: | index68.html added |
---|
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
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:4 Changed 13 years ago by
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
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
Component: | core → offset |
---|---|
Resolution: | → fixed |
Status: | new → closed |
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.