21
Feb/10
0

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!

Comments (0) Trackbacks (0)

No comments yet.

Leave a comment

No trackbacks yet.