This is a question based on: Trying to get tag-it to work with an AJAX call
However the above just creates an error message of ‘this.source is not a function’ for me.
I am trying to get this json list to appear as the tag source for tagit via ajax. Code below:
// Tagit
$("#tags").tagit({
tagSource: function() {
$.ajax({
url: "/admin/ajax.php?q=fetch_all_tags",
dataType: "json",
success: function(data) {
console.log(data);
return data;
}
});
}
});
The ajax call returns:
{"4":"php","2":"html","3":"css"}
This error was caused by me using an old version of tag it. If you get the same error make sure you are using the newest version of tagit