Error jquery-ui draggable Cannot read property 'msie'

Thyago Quintas picture Thyago Quintas · Jan 16, 2013 · Viewed 24k times · Source

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.

Answer

roman m picture roman m · Jan 19, 2013

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