我的要求是在 jQuery Ajax 调用启动时显示剑道进度条,然后在收到响应后显示 我需要关闭进度。响应可能是成功或错误,但对于这两种情况我都需要关闭进度栏。
请提供任何示例。
提前致谢。
最佳答案
请尝试以下代码,在调用ajax
之前启动进度条并在ajax完成
中停止进度条,因为无论响应如何,它都会运行成功
或错误
。
function StartProgessBar() {
kendo.ui.progress($("#progessbardiv"), true); //Here progess bar will intiate
$.ajax({
type: "POST",
url: "",
data: "",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
//no need to close the progess bar here as we have handling it in complete
},
error: function () {
////nor need to close the progess bar here as we have handling it in complete
},
complete: function () {
kendo.ui.progress($("#progessbardiv"), false); //close the progress bar
}
});
}
关于javascript - 如何实现jQuery Ajax调用的Kendo进度条?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35620010/