I've trying to use the draggable effect on some divs on a page, but whenever I load the page, I get the error message:
Error: $(".draggable").draggable is not a function
I've had a look around it seemed other people were having this problem as they had not included the jQuery UI javascript file, but I definitely have.
The following is within the head tag of my page:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js"></script>
Can anyone suggest a solution?
Any advice appreciated.
Thanks.
Quick edit, I also have the jquery tools js included in the head of the page, if I remove this it works OK. Has anyone managed to get these two working together?
I went through both your question and a another duplicate.
In the end, the following answer helped me sorting things out:
uncaught-typeerror-draggable-is-not-a-function
To get rid of :
I had to put links to Javascript libraries above the script tag I expected to be working.
My code:
Instead of
Use
Hey there, this works for me (I couldn't get this working with the Google API links you were using):
I had the same problem for another reason and my eye needed one hour to find out. I had copy-pasted the script tags that load jquery :
My website was using https when accessed from a mobile browser and refused to load jquery-ui without https.
If you are developing an Ionic app be sure to include jquery and jquery-ui before ionic.bundle.js!
such a waste of time for something so trivial :(
4 years after the question got posted, but maybe it will help others who run into this problem. The answer has been posted elsewhere on StackExchange as well, but I lost the link and it's hard to find.
ANSWER: In jQueryTOOLS, the jQuery 'core' is also embedded if you use the default download.
When you load jQuery and jQuery tools, jQuery core gets defined twice and will 'unset' any plugins. 'Draggable' (from jQuery-UI) is such a plug-in.
The solution is to use jQuery tools WITHOUT the jQuery 'core' files and everything will work fine.