I’ve been trying to make an alert that lets the user know
that if they close the window ( window.close() ) their
progress might be lost. I was able to get the alert working
and all, but when testing it, and clicking “cancel” the page
would still reload, and my progress would be lost. On the
other hand, the code I have below is how I expect it to work.
It’s difficult to test this action with Wick editor itself since Wick
has its own alert when you reload the page that only works
when your not in the project testing mode of Wick. I’d greatly
appreciate an answer of any type, thanks in advance.
onEvent('window.close()', function () {
if(confirm('Alert message')){
window.location.reload(true);
}else{
window.location.reload(false);
}
});