jQuery UI not working in WordPress plugin

Simple jQuery UI functions, such as the following:

(function($) {
    $('ui').sortable();
})(jQuery);

Result in an error which would normally indicate jQuery UI was not present.

Read More
Uncaught TypeError: Object [object Object] has no method 'sortable'

However, Chrome’s developer tools confirms that it has been loaded. What’s up?

Related posts

Leave a Reply

1 comment

  1. The answer was simply to stop using jQuery shorthand. This:

    (function($) {
        $('ui').sortable();
    })(jQuery);
    

    becomes:

    jQuery(document).ready(function($){
        $('ui').sortable();
    });