Saurabh Gupta
Saurabh Gupta

Reputation: 39

Conflicting jquery.min.js

I am using two different modules that both have jquery.min.js in my joomla site. They are conflicting on my homepage. How can I distinguish between them for the homepage and for the inside pages where the conflict does not occur?

Upvotes: 1

Views: 1475

Answers (4)

gomezluisj
gomezluisj

Reputation: 443

I have faced this problem before, each module loads its own jQuery and conflicts each other.

The solution i have implemented is installing a plugin that prevents the modules from loading jQuery.js and loads only one. Try one of these, maybe it requires little tweaks to fully work:

Sc Jquery

jQuery Easy

Upvotes: 2

di3sel
di3sel

Reputation: 2012

as sushil bharwani said: you should add <script type="text/javascript">jQuery = jQuery.noConflict();</script> into your header, right after you include jquery.min.js Also make sure you replace all '$' with 'jQuery' in your JS code.

Upvotes: 0

domx
domx

Reputation: 1

(function($){

  // code here, you could even use $ here as you like

})(jQuery);

Upvotes: 0

sushil bharwani
sushil bharwani

Reputation: 30187

$jQ = jQuery.noConflict();
$jQ("document").ready(function(){


// all the Code for Module X


});

Upvotes: 1

Related Questions