gpt4 book ai didi

jquery-ui - 删除自动完成错误的微调器/加载图像

转载 作者:行者123 更新时间:2023-12-01 06:55:44 24 4
gpt4 key购买 nike

如果自动完成出现错误/失败情况,您能否帮助我了解如何删除旋转器/加载图像?

如果我收到错误“由于意外错误,我们无法加载数据”,我会看到正在加载的图像,并且我想删除该图像。

下面是片段

  $("Autotxt").autocomplete({
source: function (request, response) {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "Webservice.asmx/GetNames",
data: "{'prefixText':'" + request.term + "'}",
dataType: "json",
success: function (data) {
response($.map(data.d, function (item) {

return {
label: item.split('|')[0],
val: item.split('|')[1]
}
}))
},

error: function (result) {

alert("Due to unexpected errors we were unable to load data");
ServiceFailed(result);
},
failure: function (response) {
alert("Due to unexpected errors we were unable to load data");

}
});
},
select: function (event, ui) {
txtSoID(ui.item.val);
},
minLength: 4
});


function txtID(val)
{
alert(val)
}

最佳答案

如果您指的是通过 ui 提供的加载类,您应该能够执行以下操作:

 error: function (result) {
$('.ui-autocomplete-loading').removeClass("ui-autocomplete-loading");
// or .hide()
alert("Due to unexpected errors we were unable to load data");
ServiceFailed(result);
},

我在 jqueryUI development site 上找到了类(class)信息在页面底部,他们讨论 CSS 和主题。

关于jquery-ui - 删除自动完成错误的微调器/加载图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9261692/

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