I am using jquery.alert.js library to display alert, it worked great exception one case. In normal situation, if i use the default alert box of Javascript, the box display and user has to click ok button then the next code logic will be executed. However, in case of jAlert, it is using callback function so it will continue to execute the behind code
and don’t have to wait for user to click on OK button
-
Default alert box
alert("There is an error");Do some thing after user click on OK ..... Some code behind
-
jAlert box
jAlert("There is an error", "error", function() { Do some thing afteruser click on OK }); ..... Some code behind
I wonder if someone could give me some hints for this situation. Is there anyway to stop the javascript code executing the code behind until user choose OK button on the box?
Thank you in advance.
1 Answer