I'm using the jQuery impromptu library and not understanding the async nature of it. I've got some code below that I want to redirect after the prompt is run. I don't want the next line of code to execute if my data.redirectPage statement is true.
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";
}
});
}
From what I read fast about Impromptu, your code looks ok.
Except the missing
}to close yoursuccessfunction... ;)AND no buttons on the submit you try to trigger.
That is an important AND.
Try this :
I suppose
vis the bolean true/false.Like said, I read real fast on Impromtu.
Personnaly, I use SweetAlert. Look for it as an alternative... May be easier.