I am trying to fit typeahead results into a separate div on my page. I get JSON callback data, but I don't know how to use it to populate a specific div. The function of the process has the only effect of listing the results, regardless of the length it takes, only under the search field.
Here is my code, do you know how to use callback data to populate a specific 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) {
},
minLength: 1
});
}
});
source
share