我有一个这样编码的按钮:
<asp:Button ID="save_all_filt" runat="server" Text="All data for filtered subjects"
ClientIDMode="Static" OnClientClick="a= saveAllFilt(); return a; "
OnClick="save_all_filt_Click" />
saveAllFilt 是一个调用普通 JQuery ajax 调用的函数。像这样的东西:
function saveAllFilt() {
jQuery.ajax({
async: false,
dataType: 'json',
contentType: "application/json; charset=utf-8",
type: "POST",
url: contentURL,
data: dataarray,
success: function (msg) {
// Some processing here. ONLY WHEN IT IS DONE, I NEED TO HAVE POSTBACK.
},
error: function (data) {
}
}); // end of ajax call.
}
我想要这样的事情:onClick 应该只在 ajax 调用完成后继续。我怎么能这样做?