I'm using Jquery tag-it to get a list of keywords from a remote json string - this works fine.
However what I've now got is a situation where instead of jquery 'drilling down' as you type its trying to do a search query on
somefile.php?q=foo
(foo being what you've just typed. This would drill-down the tag list to only show those with 'foo' in them.
I'm using Laravel 4, so I need to basically change the ajax request so that it instead does /somefile/foo
. Is there any way of doing this? I've been searching around like crazy but cant find a solution.
For reference, here's the tag-it code I currently have:
$("#tags").tagit({
autocomplete: {delay: 0, minLength: 2},
allowSpaces: true,
onlyAvailableTags : false,
tagSource: function(search, showChoices)
{
var that = this;
$.ajax({
url: "/admin/keywords/autocomplete",
data: { term:search.term },
dataType: "json",
success: function(choices)
{
showChoices(that._subtractArray(choices, that.assignedTags()));
}
});
}
});