javascript - 如何实现jQuery Ajax调用的Kendo进度条?

标签 javascript jquery ajax kendo-ui

我的要求是在 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/

相关文章:

javascript - 如何使用 Javascript 编码链接+显示消息

javascript - 如何动态调整div的left属性

c# - ASP.NET Core 模型未通过 AJAX 绑定(bind)到 Controller

asp.net - UpdatePanel 启动脚本未执行

Javascript RegEx 为用户返回不同的结果

javascript - 我可以通过索引而不是名称引用 ngRepeat 中的项目吗

javascript - 调整浏览器大小时,SVG 顶部有空白

jquery - Node.js - 提交表单

jquery - CSS transition 在被隐藏后短暂地导致元素为 "hoverable"

jquery - 文本框未触发 asp.net 必填字段