Typeahead.js 如何更改URL?
这是我的JS脚本Typeahead.js 如何更改URL?,typeahead.js,typeahead,bootstrap-typeahead,Typeahead.js,Typeahead,Bootstrap Typeahead,这是我的JS脚本 function fillCities(country) { console.log('fillCities', country); var url = 'ajax.php?action=getVilles&country='+country+'&ville=%QUERY'; console.log('url', url); $('#city').typeahead('destroy'); $('#city').t
function fillCities(country) {
console.log('fillCities', country);
var url = 'ajax.php?action=getVilles&country='+country+'&ville=%QUERY';
console.log('url', url);
$('#city').typeahead('destroy');
$('#city').typeahead({
name : 'city',
displayKey: 'city',
valueKey: 'city',
limit:10,
cache: false,
minLength:3,
remote: {
url : url
}
});
}
问题是:当国家/地区发生变化时,typeahead总是请求相同的url,而不会更改url
如何动态更改URL(URL中的国家参数)