我正在从特定 URL 检索数据,但为了获得正确的结果,我需要删除一个参数。
当前由令牌输入生成的 URL 是:-
http://developer.echonest.com/api/v4/artist/suggest?api_key=W8ZWNWH6N&name=radiohead&_=1320665341820
我需要删除最后一部分:-
&_=1320665341820
我怎样才能做到这一点,以便令牌输入只生成具有以下格式的 URL:-
http://developer.echonest.com/api/v4/artist/suggest?api_key=W8ZWNWH6N&name=radiohead
我当前的“令牌输入”初始化代码是:-
$("#similar_artists").tokenInput("http://developer.echonest.com/api/v4/artist/suggest?api_key=W8ZWEXAMPLEWH6N", {
hintText: "Please begin typing the name of a famous artist who has the kind of sound you are looking for. You may select as many as you wish.",
theme: "facebook",
onAdd: function (item) {
filterDatatable();
},
onDelete: function (item) {
filterDatatable();
},
searchDelay: "0",
tokenDelimiter: ", ",
animateDropdown: true,
preventDuplicates: true,
deleteText: "",
tokenValue: "name",
crossDomain: false,
tokenLimit: "6",
queryParam: "name",
noResultsText: "There are no valid artists that match your request, please try again.",
onResult: function (data) {
return data['response']['artists'];
}
});
});