I think you need a confirmation message not the alert here is how
var r = confirm("Successful Message!");
if (r == true){
window.location.reload();
}
or here is an alternate.
if(alert('Alert For your User!')){}
else window.location.reload();
short version
if(!alert('Alert For your User!')){window.location.reload();}