リモートjson文字列からキーワードのリストを取得するためにJquery tag-itを使用しています-これは正常に機能します。
しかし、私が今持っているのは、入力時にjqueryが「ドリルダウン」する代わりに、検索クエリを実行しようとする状況です
somefile.php?q=foo
(foo は今入力したものです。これにより、タグ リストがドリルダウンされ、「foo」を含むものだけが表示されます。
私はLaravel 4を使用しているので、基本的にajaxリクエストを変更して、代わりに/somefile/foo
. これを行う方法はありますか?私は狂ったように探し回っていますが、解決策を見つけることができません。
参考までに、私が現在持っている tag-it コードは次のとおりです。
$("#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()));
}
});
}
});