i have problem with using jquery-ui auto-complete for json. say, my json query return from myurl/users/listid and this is the returning data:
[{"label":"[email protected]"},{"label":"[email protected]"},{"label":"[email protected]"}]
and this is my jquery script for autocomplete.
$("#search-query").autocomplete({
source: '/users/listid'
});
when i type something into my #search-query input box, this all three email id are shown regardless what i type. it should narrow it down to what it matches to the character i try to type. but it doesn't.
okay. this is something wierd. when i change something like following script, everything works perfect.
var data = [{"label":"[email protected]"},{"label":"[email protected]"},{"label":"[email protected]"}];
$("#search-query").autocomplete({
source: data
});
i have totally no idea what has gone wrong. please guide me. thanks.