Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

$.widget is not a function

Tags:

jquery

I want to make use of some dragable elements.. but as soon as I load the page I get this

$.widget is not a function

the code

<script src="js/jquery/jquery-1.6.js" type="text/javascript"></script>

<script src="js/jquery/jquery.ui.core.js" type="text/javascript"></script>
<script src="js/jquery/jquery.ui.draggable.js" type="text/javascript"></script>
<script src="js/jquery/jquery.ui.mouse.js" type="text/javascript"></script>
<script src="js/jquery/jquery.ui.widget.js" type="text/javascript"></script>
like image 481
clarkk Avatar asked May 11 '11 18:05

clarkk


2 Answers

Place your widget.js after core.js, but before any other jquery that calls the widget.js file. (Example: draggable.js) Precedence (order) matters in what javascript/jquery can 'see'. Always position helper code before the code that uses the helper code.

like image 187
Greg Avatar answered Oct 05 '22 05:10

Greg


Maybe placing the jquery.ui.widget.js as second after jquery.ui.core.js.

like image 28
jerone Avatar answered Oct 05 '22 05:10

jerone