jquery - Typeahead Bloodhound POST request -
I can not get a remote query to properly use POST. Replace: "../getcreditors", function: (url, query) {return url + "#" + query;}, ajax: {type: "post", data: $ .perm ({q: queryInput.val ( )})}}});
queryInput.val () does not receive the current value of the object, only the value of the time that the iron object is given immediately. How do I get query string in AJAX data options?
You can first use $ .ajax
var Creditors = new bloodhound ({datumTokenizer: function (d) {return bloodhound.tokenizers.whitespace (d.value)}, querytochnizer: Bloodhound.tokenizers.whitespace, Remote: {url: "../getcreditors", Replace: Function (Url, query) {return url + "#" + query;}, ajax: {before: function: (jqXhr, settings) {settings.data = $. Param ({q: queryInput.val ()}}} , Type: "POST"}}});
Comments
Post a Comment