WalterRR
asked on
Javascript Alert Box - catch click
Hi
I would like to catch the click of an alert box and reload location at this point. Currently I have reload at the end of the function which is not the desired behaviour
I would like to catch the click of an alert box and reload location at this point. Currently I have reload at the end of the function which is not the desired behaviour
function myFunction(url, myuser, myprocessing){
var xhr = $.ajax({
"url": url,
"data": { creatio: myuser, reqiu : myprocessing},
"error":
function(jqXHR, textStatus, errorThrown) {
alert(jqXHR.responseText);
},
"success":
function(jqXHR, textStatus, errorThrown) {
alert("Success"); << ONCLICK of Alert... location.reload(); >>
if($('#inspect-modal').data('modal').isShown == true) {
$('#inspect-modal').modal('hide');
}
}
});
location.reload(); <<remove this>>
}
ASKER
Thanks for the reply...
The reason i wasn't using a Confirm() was this is just a success message back to the user. There will be nothing to cancel. If I have a confirm() i don't think I can have this without the cancel button?
Maybe I have no option in this case?
W
The reason i wasn't using a Confirm() was this is just a success message back to the user. There will be nothing to cancel. If I have a confirm() i don't think I can have this without the cancel button?
Maybe I have no option in this case?
W
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
the solution
http://www.javascripter.net/faq/confirm.htm
http://www.w3schools.com/jsref/met_win_confirm.asp