令牌输入插件: - 更改ajax请求URL

时间:2011-11-07 11:49:21

标签: jquery ajax json jquery-tokeninput

我正在从特定网址检索数据,但为了收到正确的结果,我需要删除参数。

目前由令牌输入生成的网址为: -

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'];
                }

});

});

0 个答案:

没有答案