I am using a easyAutoComplete plugin. I need to abort previous ajax request on new request. Here is the link of plugin which I used. http://easyautocomplete.com/
and my code is
var options = {
url: function (phrase) {
return "api/getData";
},
getValue: function (element) {
return element['name'];
},
ajaxSettings: {
dataType: "json",
method: "POST",
data: {
dataType: "json"
}
},
preparePostData: function (data) {
data.phrase = $(".name").val();
return data;
},
match: {
enabled: true
}
};
$(".name").easyAutocomplete(options);