I'm trying to fit typeahead results into a particular div on my page. I get the JSON callback data but I don't know how to use it in order to populate a particular div. The process function has the only effect of listing the results, whatever the length it takes, just under the search field.
Here is my code, do you know how to exploit the callback data in order to populate a particular div ?
$('#search').typeahead({
source: function(query, process) {
$.ajax({
url: '/action/search.php?action=autocomplete',
type: 'POST',
data: 'query=' + query,
dataType: 'JSON',
async: true,
success: function(data) {
//process(data);
},
minLength: 1
});
}
});