Confirm, you can click cancel, and the reboot will fail!
Instead, you can use something like this:
if(alert('Alert For your User!')){} else window.location.reload();
This will display a warning for your user, and when he clicks OK, he will return false and the reboot will be done! :) Also, a shorter version:
if(!alert('Alert For your User!')){window.location.reload();}
I hope this helps !? :)
Bojan milic
source share