我有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
?
感谢大家的时间