Oksana King Oksana King - 1 month ago 26
jQuery Question

Jquery Uncaught TypeError: $(...).draggable is not a function

I am using these links:

<script type = "text/javascript" src = "jquery.min.js"></script>
<link rel="stylesheet"
href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css">

<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js">
</script>


And then this in the script:
$( "#draggable" ).draggable();


It shows an error
$(...).draggable
is not a function.

Any ideas?

Answer

I believe #draggable does not exist when you try to reach it. You might try something like this:

<script type="text/javascript>
    $(function() {
        $( "#draggable" ).draggable();
    });
</script>
Comments