我正在使用 jQuery 即兴库,但不了解它的异步性质。我在下面有一些代码,我想在提示运行后重定向。如果我的 data.redirectPage 语句为真,我不希望执行下一行代码。
success: function (data) {
if (data.redirectPage == "hackathonregistration") {
$.prompt("Your code has been accepted and you will now be redirected to the hackathon registration page",
{
submit: function() {
window.location.href = "/Register/hackathon";
}
});
}