1

Closed

oomph.js breaks other uses of jquery on the page

description

See comments -- there's not a fix specifically.
 
Hi,
I'm working on integrating oomph into mojoPortal (an open source cms [url:http://www.codeplex.com/mojoportal]).
When I add the oomph.js or oomph.min.js to a page it breaks other useage of jquery on the page.
The cause is this line of code in oomph.js:
oomph = jQuery.noConflict(true);
I was able to fix it by changing that line to this:
oomph = jQuery;
 
Reading the documentation here:
[url:http://docs.jquery.com/Core/jQuery.noConflict]
It seems this call should be avoided unless its needed to avoid other conflicts like with prototype or something, but making this call causes its own conflicts since it breaks other uses of jquery.
Closed Nov 25, 2008 at 6:41 PM by karstenj

comments

karstenj wrote Nov 11, 2008 at 4:31 PM

Namespace collision and javascript: ugly stuff. Because the toolbar injects both jQuery and the oomph script, we have to be super conservative in order not to break other people's sites. That's why we call noConflict(true) which aliases the jQuery and $ namespace to _jQuery and _$. But in the case where you are manually adding Oomph to your site, you have more control over what is happening and yes you are right, changing the noConflict line should resolve the issue. Thanks for calling this out.