Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error jquery-ui draggable Cannot read property 'msie'

I got some troubles to make work jquery-ui draggable. I will share with you my solution, this is the best solution?

I just insert this to test before I start my real work.

<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.24/jquery-ui.min.js"></script>

and

  $('img').draggable();

Like here: http://jsbin.com/eqowet/2/

But I got a error:

Error: Uncaught TypeError: Cannot read property 'msie' of undefined.

like image 468
Thyago Quintas Avatar asked Jan 16 '13 19:01

Thyago Quintas


3 Answers

msie is the flag on the jQuery.browser property

jQuery.browser was deprecated since version 1.3 and was removed in jQuery 1.9.0

Since you're using the latest version of hosted jQuery, your library was auto-upgraded to 1.9.0 hence the error.

As you've already realized, reverting back to 1.8.3 (or earlier version) fixes the issue; the real solution, however, is to stop using jQuery.browser

like image 121
roman m Avatar answered Oct 20 '22 16:10

roman m


I try a lot of examples but all isn't working, just the same message, that I realized the version 1.8.24 isn't compatible with the last jQuery version. I have changed for it and voilà is working now.

<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>

Like here: http://jsbin.com/eqowet/3/

like image 45
Thyago Quintas Avatar answered Oct 20 '22 15:10

Thyago Quintas


You can use migrate.js to get compatibility

http://blog.jquery.com/2013/02/16/jquery-migrate-1-1-1-released/

like image 35
dstonek Avatar answered Oct 20 '22 15:10

dstonek