HI,
I have added an unload event to my page like :
window.addEventListener('unload', function(event) {
if(cancel === false) {
return "Changes you made will not be saved";
}
});
Bascially when unloading happens i want a confirmation dialog to appear
with two buttons ok and cancel. And if user presses ok then proceed with the normal flow otherwise stop closing of the current window.
But somwhow the dialog itself is not appearing. Many places say that
you cannot have confirmation dialog from inside an unload event so i tried returning a string but that also didnt work.
I am making it work in chrome .
Thanks
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Fellow title is reserved for select members who demonstrate sustained contributions, industry leadership, and outstanding performance. We will announce the experts being inducted into the Experts Exchange Fellowship during the annual Expert Awards, but unlike other awards, Fellow is a lifelong status. This title may not be given every year if there are no obvious candidates.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.