我似乎無法得到正確使用POST的遠程查詢。Typeahead Bloodhound POST請求
var creditors = new Bloodhound({
datumTokenizer: function (d) {
return Bloodhound.tokenizers.whitespace(d.value)
},
queryTokenizer: Bloodhound.tokenizers.whitespace,
remote: {
url: "../getCreditors",
replace: function(url, query) {
return url + "#" + query;
},
ajax : {
type: "POST",
data: $.param({q: queryInput.val()})
}
}
});
的queryInput.val()不會只得到當時獵犬對象的值實例化對象的當前值。如何將查詢字符串放入ajax數據選項中?
https://stackoverflow.com/a/46927923/3966458沒有Ajax –