为什么其他一切都在JQuery $ .post之前执行?

时间:2017-04-10 12:36:32

标签: javascript jquery

我有2个Javascript函数

function populate_edit_form_template(template_container_id, tabpane_id, template_selector) {
        if (!$(tabpane_id).hasClass("has_edit_template")) {
            $(tabpane_id).addClass("has_edit_template");
            var template_content = $(template_container_id).html();
            $(tabpane_id).html(template_content);
            $(tabpane_id).find(template_selector).attr("style", "");
        }
    }

function get_current_form_info(tabpane_id,form_id,process_url) {
        var form_verification_data = {
            "process_type":3,
            "form_id": form_id,
        };
        $.post(process_url, form_verification_data, function (data) {
            $(tabpane_id).append(data);
        });
    }

我首先运行 get_current_form_info ,然后 populate_edit_form_template ,但不知何故后者首先执行。

我在想: 1.如何始终强制$.post先运行 2.为什么延迟$.post

感谢大家的时间

0 个答案:

没有答案