gpt4 book ai didi

jQuery UI AutoComplete - 如何实现进度指示器?

转载 作者:行者123 更新时间:2023-12-01 08:25:50 25 4
gpt4 key购买 nike

如果问题标题不够清晰:

我正在使用 jQuery AutoComplete 插件(jQuery UI 1.8.5 的一部分)

我本以为提供的 CSS/图像会包含类似 ajax 的进度图像?

如果没有,创建一个最简单的方法是什么?

这是我的自动完成代码:

$('#query').autocomplete({
source: function (request, response) {
$.ajax({
url: "/Search/FindLocations",
type: "POST",
dataType: "json",
data:
{
searchText: request.term
},
success: function (data) {
response($.map(data, function (item) {
return { name: item.name, value: item.name }
}))
}),
select: function (event, ui) {
// snip... (this is where i display stuff about what they clicked).
}});

上面代码中我应该在哪里隐藏/显示图像?

显然,在“选择”中的代码之后,我可以隐藏图像,但是我可以在哪里“显示”图像?

最佳答案

$('#query').autocomplete({
source: function (request, response) {
//i would show the image here, before starting your ajax request
$("#theImage").show();
$.ajax({
url: "/Search/FindLocations",
type: "POST",
dataType: "json",
data:
{
searchText: request.term
},
success: function (data) {
response($.map(data, function (item) {
return { name: item.name, value: item.name }
}))
}),
select: function (event, ui) {
// snip... (this is where i display stuff about what they clicked).
}});

关于jQuery UI AutoComplete - 如何实现进度指示器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3975291/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com