I am use remote url with json response ( New typeahead.js)
my javascript :
$(document).ready(function() {
$('input.country').typeahead({
valueKey: 'name',
remote : {
url : 'example.in/d.php?query=%QUERY',
filter: function (parsedResponse) {
var dataset = [];
for (i = 0; i < parsedResponse.length; i++) {
dataset.push({
name: parsedResponse[i].name
});
}
if (parsedResponse.length == 0) {
dataset.push({
name: "No results"
}); }
return dataset;
},
},
});;
})
my json response :
[{"name":"Nokia 110",url:"example.com/nokia-110"},{"name":"Nokia 210",url:"example.com/nokia-210"}]
so how to give URL link on selected name ?