I have this code:
$("input#autocomplete").autocomplete({
source: ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby"]
});
and it works. If I try to put anything else in there like:
$("input#autocomplete").autocomplete({
alert ("test");
source: ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby"]
});
then it doesn’t work and gives this error: syntax error: unexpected string.
I was hoping to make an AJAX call before the source: call so that I can get the data to display to the user. Am I misunderstanding something in how this is supposed to work?
Thanks!!
see the autocomplete events, i think the “search” event is the one you need, here is a link http://jqueryui.com/demos/autocomplete#event-search
here is an ajax example