Title: jQuery UI &#8211; is not a function
Last modified: August 21, 2016

---

# jQuery UI – is not a function

 *  Resolved [am71722](https://wordpress.org/support/users/am71722/)
 * (@am71722)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/jquery-ui-is-not-a-function/)
 * I’ve seen this problem a lot but no one ever comes up with a solution. I’m getting
   an error saying .sortable/.draggable/.droppable are not functions. Can anyone
   help? Relevant code below:
 * //template page
 *     ```
       <script>
           jQuery(document).ready(function() {
               jQuery("#sortable").sortable({
                   revert: true
               });
               jQuery("#draggable").draggable({
                   connectToSortable: "#sortable",
                   helper: "clone",
                   revert: "invalid"
               });
               jQuery("ul, li").disableSelection();
           });
       </script>
       ```
   
 * //functions page
 *     ```
       /*load custom javascript*/
       function occ_scripts_method() {
       	wp_enqueue_script('jquery-ui-datepicker');
               wp_enqueue_script('jquery-ui-sortable');
               wp_enqueue_script('jquery-ui-draggable');
               wp_enqueue_script('jquery-ui-droppable');
               wp_enqueue_script(
       		'custom-script',
                       get_stylesheet_directory_uri() . '/lib/js/occscripts.js',
       		array( 'jquery' )
       	);
   
               wp_enqueue_style('jquery-style', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css');
       }
       add_action( 'wp_enqueue_scripts', 'occ_scripts_method' );
       ```
   

Viewing 1 replies (of 1 total)

 *  Thread Starter [am71722](https://wordpress.org/support/users/am71722/)
 * (@am71722)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/jquery-ui-is-not-a-function/#post-4223983)
 * I think I understand why this never gets answered. Its because it comes from 
   dumb coding mistakes. I was using head and body tags in my template.
 * LESSON: Don’t do that. And pay attention to copy and pasted code.

Viewing 1 replies (of 1 total)

The topic ‘jQuery UI – is not a function’ is closed to new replies.

## Tags

 * [enqueue](https://wordpress.org/support/topic-tag/enqueue/)
 * [jquery](https://wordpress.org/support/topic-tag/jquery/)
 * [ui](https://wordpress.org/support/topic-tag/ui/)

 * 1 reply
 * 1 participant
 * Last reply from: [am71722](https://wordpress.org/support/users/am71722/)
 * Last activity: [12 years, 7 months ago](https://wordpress.org/support/topic/jquery-ui-is-not-a-function/#post-4223983)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
