如何设置JQuery的自动填充功能POST而不是得到什么? [英] How do I set JQuery Autocomplete to POST instead of GET?

查看:133
本文介绍了如何设置JQuery的自动填充功能POST而不是得到什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法来设置jQuery的自动完成HTTP提交方法为POST,而不是得到什么?

Is there a way to set Jquery's Autocomplete HTTP submission method to POST instead of GET?

推荐答案

不幸的是,没有选择的autocompleter,将允许您设置。然而,有,在插件code其中的 $。阿贾克斯函数被调用一个地方。没有指定键入选项,这意味着它会默认为GET请求。你可以修改 $。阿贾克斯调用(开始于最新版本的361线),以包括键入选项并将其值设置为后:

Unfortunately, there is no option to the autocompleter that will allow you to set that. There is, however, a single place in the plugin code where the $.ajax function is called. There is no type option specified, which means that it will default to a GET request. You could modify the $.ajax call (which starts on line 361 of the latest version) to include a type option and set its value to "post":

$.ajax({ //line 361
    type: "post",
    ...

这篇关于如何设置JQuery的自动填充功能POST而不是得到什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆