jquery - 使用自动完成功能在 Jquery 中发送请求并获得响应?
问题描述
我正在尝试发送带有值的请求,Pubid:1, pubdate:"2021-02-14"
但在发送请求后也没有任何工作,当响应获取时,我试图获取数据并在响应时运行jquery 自动完成。
供参考,请检查我的界面并单击标题文本框我正在标题文本框中实现
<div class="input-group">
<label class="label">Headline</label>
<input class="input--style-4" type="text" id="head">
</div>
$( "#head" ).autocomplete({
source: function (request, response) {
$.ajax({
type: "POST",
url:"https://myimpact.in/deletearticle/services/articlelist.php",
data: {term:request.term,Pubid:"1",pubdate:"2021-02-14"},
success: response,
dataType: 'json',
minLength: 2,
delay: 100
});
}
});
解决方案
推荐阅读
- javascript - 如何将一个div附加到另一个div
- php - PHP/Guzzle 目标父元素
- arrays - 提取 Fortran 字符串数组的子字符串
- tinymce - TinyMCE 将查询字符串中的 & 符号转换为 HTML 实体
- javascript - 如何使用 V8 引擎从 C++ 获取 javascript 字节码
- scala - 为在 Web 应用程序中运行的 Spark 设置 spark.driver.memory
- javascript - 节点readline输入重叠
- sql - 好友请求的数据库设计
- javascript - 如何使用此 Javascript 解决方案在 Web 表单上的 div 之间正确切换?
- excel - 使用 SumProduct 的加权平均 IFs 语句