Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery Autocomplete (1.8.5) - Uncaught TypeError, property 'source' is not a function

I am attempting to use the jQuery autocomplete widget which I have used previously on earlier versions of jQuery.

With the code I'm currently using (and jQuery UI 1.8.5) I am getting the following error when typing a letter in the initialised autocomplete input field:

jquery-ui-1.8.5.custom.min.js:320Uncaught TypeError: Property 'source' of object #<an Object> is not a function

The autocomplete code is basically the jQuery example documentation (added to my page with other JS on it):

<input type="text" id="example" />
<script type="text/javascript">
    var data = "Core Selectors Attributes Traversing Manipulation CSS Events Effects Ajax Utilities".split(" ");
    $("#example").autocomplete(data);
</script>

Anyone have any suggestions?

Thanks in advance.

like image 522
Ed . Avatar asked Jan 14 '11 16:01

Ed .


1 Answers

I think that should be:

$("#example").autocomplete({ source: data });
like image 179
Lazarus Avatar answered Oct 17 '22 18:10

Lazarus