我想将自定义变量发送到url,如customID:5.how我可以添加此代码.Plz帮助
$("#e8").select2({
placeholder: "Search for another Concept",
minimumInputLength: 1,
multiple: true,
ajax: { // instead of writing the function to execute the request we use Select2's convenient helper
url: "sendchat3.php",
dataType: 'json',
data: function (term, page) {
return {
q: term, // search term
page: page
};
},
results: function (data, page) {
return { results: data};
}
}
});
答案 0 :(得分:1)
...
data: function (term, page) {
return {
q: term, // search term
customID: 5,
page: page
};
},
...