Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery Uncaught TypeError: Object[object Object] has no method slider

Here is the page url http://meracd.com/design/disc_designer.php?disc=cd

I've used jqueryUI for the slider. But it isn't working. I've loaded jquery and jquery UI before the custom.js script.

enter image description here

like image 869
Bilbo Baggins Avatar asked Feb 24 '12 17:02

Bilbo Baggins


2 Answers

You have multiple instances of jQuery on your page.

Your jQuery UI Slider Plugin is attaching to window.jQuery (which is version 1.6.2), but your custom.js code is trying to run against window.$ (which is version 1.6.4).

You need to either:

  • Get rid of one of them (there's no need to have both)
  • Alias the jQuery used in custom.js
  • Use noConflict() to resolve which jQuery gets access to the $ variable.
like image 200
Yahel Avatar answered Oct 18 '22 03:10

Yahel


You saved my day, in my case, adding noConflict() solved my problem

sample of my code

#

MVC 4

<script src="/Scripts/jquery-1.8.3.js"></script>
<script src="/Scripts/jquery-ui-1.9.2.js"></script>

jQuery.noConflict();
$(function(){
                 //  var $searchBox =  $("input#SearchString");
                   $("input#SearchString").autocomplete({
                       source: []
                   });
          });
like image 34
2 revs Avatar answered Oct 18 '22 04:10

2 revs