-2

我想将自定义变量发送到 customID:5 之类的 url。如何添加此代码。请帮助

            $("#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};

                }
            }
        });
4

1 回答 1

1
...
            data: function (term, page) {
                return {
                    q: term, // search term
                    customID: 5,
                    page: page
                };
            },
...
于 2013-03-26T13:41:33.990 回答