日期:2014-05-16  浏览次数:20423 次

jquery同时发送两个异步ajax请求,但数据却是按同步顺序返回

var isComplete = false;
        $(
            function () {
                $("#dialog-message").dialog({
                    resizable: false,
                    modal: true,
                    autoOpen: true
                });
                $("#dialog-message").html("<p>正在加载...</p>");
                setTimeout(function () {
                    $.ajax({
                        type: "POST",
                        url: "ajax/querylist.ashx",
                        datatype: "json",
                        success: function (msg) {
                            $("#dialog-message").html("<p>加载完成!</p>");
                            isComplete = true;
                            setTimeout(function () {
                                $("#dialog-message").dialog("close");
                            }, 500);
                        }
                    });
                }, 0);
            }
        );

            function querystatus() {
                $.ajax({
           &