【问题标题】:jQuery UI Autocomplete GET changejQuery UI 自动完成 GET 更改
【发布时间】:2014-02-14 03:04:36
【问题描述】:

我对 jQuery UI 自动完成有疑问。在我的平台网址是这样的:

mysystem/module/action/cash/param/value

但在 jQuery 自动完成中,当我设置源:“搜索”时,url 像:

mysystem/module/action/search?term=aza

所以我想更改为我的 url 格式(可能通过少量更改库 jQuery 自动完成)或删除 GET 方法并发送数据 POST 方法。

谢谢,我修好了:

来源:函数(req,resp){ $.getJSON(link_ajax +"/term/" +encodeURIComponent(req.term)); }

【问题讨论】:

    标签: jquery autocomplete


    【解决方案1】:

    请参阅source 选项。您可以使用函数版本来准确控制请求的外观:

    source: function (request, response) {
        $.ajax({
            url: 'mysystem/module/action/search/' + encodeURIComponent(request.term),
            dataType: "json",
            type: "GET",
            success: function (data) {
                //note - you may need to translate the data into a format the plugin can use
                response(data);
            }
        });
    }
    

    【讨论】:

      猜你喜欢
      • 2015-03-17
      • 1970-01-01
      • 2011-02-06
      • 1970-01-01
      • 2011-10-04
      • 2011-07-23
      • 1970-01-01
      相关资源
      最近更新 更多