0

In magento 1 when merged javascript files is set to "yes" I encountered this error :

enter image description here

When merged javascript files is set to "No" there was no problem with jquery datepicker.

Do you have any idea how to solve this issue ?

Thanks

EDIT

When I click on the error in the console, the end of this line "throw e;}" is underline in red :

return before+String.interpret(ctx);});}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable=(function(){function each(iterator,context){var index=0;try{this._each(function(value){iterator.call(context,value,index++);});}catch(e){if(e!=$break)throw e;}
0

Include the jquery.noConflict in the app/design/frontend/default/[theme name]/template/page/html/head.phtml file

<script type="text/javascript">
  $.noConflict(); //Use no conflict here instead of js file
  // Code that uses other library's $ can follow here.
</script>

-if still not working then

Create a different alias instead of jQuery to use in the rest of the script.

<script type="text/javascript">
    var $j = jQuery.noConflict();
    $j( "#datepicker" ).datepicker();
</script>
  • Now I have this error : Uncaught TypeError: $.noConflict is not a function – fabienb Oct 3 at 14:15
  • Please replace $.noConflict(); with jQuery.noConflict(); – Rajesh Hothi Oct 3 at 14:18
  • Ok it's better, but I still have "JQuery(...).datepicker is not a function" error.And I can't make your second solution, because there was more than 4140 results for .datepicker in my project.. – fabienb Oct 3 at 14:30
  • If you have included multiple jQuery library then keep only latest version and remove all other jQuery library – Rajesh Hothi Oct 3 at 14:33
  • And check that jQuery library call order is older to latest – Rajesh Hothi Oct 3 at 14:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.