I need jsondata variable to be global so I can use it later on in the script.
$.ajax({
url: "data.json",
data: {term: $("#tags").val()},
dataType: "json",
success: function(out) {
var jsondata = $.map(out, function(item) {
return {
label: item[0]
};
});