如何在等待回应时显示动画的等待讯息 [英] how to display animated wiating message while wiating for response

查看:182
本文介绍了如何在等待回应时显示动画的等待讯息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
请我帮忙.

三天以来,我一直在寻找一个成功的解决方案,但没有成功:(

我的网站解决方案包括两个页面.
一个aspx页面用于发送xmlhttprequests,另一个aspx页面用于获取请求并返回响应.
*我以同步模式发送请求

例如:

hello everyone,
Please I need help.

For three days now that I''m searching for a good solution without any success :(

I have a website solution includes two pages.
One aspx page is used for sending xmlhttprequests and another aspx page is used for getting the requests and return the responses.
* I''m sending the requests in sync mode

For exapmle:

function ExpandAll() {
    var treeviewCell = document.getElementById('cell_treeview');
    var treeview = treeviewCell.childNodes[0];
    if (treeview != null) {
        for (var r = 0; r < treeview.rows.length; r++) {
            var nodeID = treeview.rows[r].id.split('_')[1];
            ExpandBranch(nodeID);
        }
    }
}





function ExpandBranch(nodeID) {
           var data = "<Node Action=\"GetBranch\" ID=\"" + nodeID + "\" />"; //send xmlhttprequest for getting branch
           var xmlDoc = ReadData(SendData(data)); //read the response as xml document
           var nodes = xmlDoc.getElementsByTagName("Node[@HasChilds=\"True\"]");
           for (var n = 0; n < nodes.length; n++) {
               var nodeID = nodes[n].getAttribute("ID");
               if (ShouldBeExpanded(nodeID)) {
                   CollapseExpand(nodeID); //again send xmlhttprequest for getting childs
               }
           }





我想在ExpandAll之前显示动画消息,并在ExpandAll完成后将其隐藏

可能吗?

谢谢





I wat to display an animated message before ExpandAll and hide it after ExpandAll is finished

Is it possible?

Thank you

推荐答案

在这里看看, JQuery Ajax [< ^ ]

您不需要两个aspx页面.您的ajax脚本可以调用PageMethod或Web服务来获取请求的数据.

使用jQuery调用PageMethod [
Have a look here, JQuery Ajax[^]

You don''t need two aspx pages. Your ajax script can call a PageMethod or web service to get the requested data.

Calling a PageMethod with jQuery[^]


这篇关于如何在等待回应时显示动画的等待讯息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆