21
Feb/100
Feb/100
How to define a jQuery autocompleter callback function
I have spent a lot of time on creating a working callback function for the jQuery autocomplete plugin (http://docs.jquery.com/Plugins/Autocomplete).
Here is a working example:
var url="http://mydomain/myscript.php" $("#search_field").autocomplete( url, {minChars:3, scroll:true, scrollHeight:400 })}).result( function(event, data, formatted) { //this is the callback alert(data) });
You can see that the callback function should be encapsulated in the result() function.
Have fun!
