I'm trying to fetch designations from database using ajax and php and store those values in a javascript variable designations. I'm trying to set the availabletags option of tagit() from this designation variable.
var tagThis = $(".tagit");
tagThis.tagit({
tagSource: function(search, showChoices) {
$.ajax({
type : 'POST',
url: "/tags/search",
data: { queryString: inputString },
dataType: "json",
success: function(data) {
var assigned = tagThis.tagit("assignedTags");
var filtered = [];
for (var i = 0; i < data.length; i++) {
if ($.inArray(data[i], assigned) == -1) {
filtered.push(data[i]);
}
}
showChoices(filtered);
}
});
}
});
The drop down isn't getting produced when I change the type to POST.