TypeError: $(...).autocomplete is not a function
<p>I am getting the above error using the following code inside a Drupal module.</p>

<pre><code>jQuery(document).ready(function($) {
        $("#search_text").autocomplete({
            source:results,
            minLength:2,
            position: { offset:'-30 0' },  
            select: function(event, ui ) { 
                    goTo(ui.item.value);
                    return false;
            }        
    }); 
});
</code></pre>

<p>Jquery is definitely loaded, and I have tried using a different variable for $ - any ideas what else might be the problem?</p>

<p>(Edit) Drupal specific answer for autocomplete:</p>

<pre><code>drupal_add_library('system', 'ui.autocomplete');
</code></pre>
