Jump to content

jquery conflict?[solved]


Recommended Posts

it's not prestashop's fault but the (previously listed) .js file is creating javascript errors when running off of jquery-1.4.4.min.js or the older version it ran nativly with. it breaks the ajax functionality of the cart and firebug shows error with .js file from productscategories module as well, but otherwise runs fine. anybody know how to modify it so it will run with jquery-1.4.4.min.js without breaking the cart or throwing up errors? i'd appreciate it.

Link to comment
Share on other sites

  • 2 years later...
  • 4 weeks later...

I'm including what helped me with similiar issue. I'm using Prestashop 1.5.4.0. I have 2 jquery elements on my home page. I simply added the following code in each script:

 

$.noConflict();
 jQuery(document).ready(function($) {

 

This is an example script of what it should look like:

 

<script type="text/javascript" src="js/jquery/jquery-1.7.2.min.js"></script>	   
<script type="text/javascript" src="js/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="js/jquery.coda-slider-2.0.js"></script>
  <script type="text/javascript">

   $.noConflict();
 jQuery(document).ready(function($) {

   $('#coda-slider-2').codaSlider({
	   autoSlide: true,
	   autoSlideInterval: 4000,
	   autoSlideStopWhenClicked: true,
		 dynamicArrows: false,
   });
  });

  </script>

  • Like 1
Link to comment
Share on other sites

  • 2 months later...

Mouse, you save my day.

 

I tried to use jQuery.noConflict() instead $.noConflict()

Also, the call to ready function was $(document).ready(function() { // (Note function(EMPTY)).

I follow your sample code and add jQuery(document).ready(function($and now is working.

 

Thanks a lot.

Edited by wippa (see edit history)
  • Like 1
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...