Fred Victa wrote:I'm working on an application that uses Javascript. When the user attempts to close a Web page, there is a pop-up window that comes up with two buttons: Leave this page and Stay on this page. How would I know if the user clicked on the "Leave this page" button? How would I know what the user clicked when using window.onbeforeunload?
Mary Delamater wrote:Hi Fred
Sorry for the delay in answering - I wasn't sure what to say. The fact is that I don't work with windows much - even back in the day, when they were more popular, I generally avoided them. The book covers the basics of working with windows, but doesn't go in to a lot of detail, because there isn't much demand anymore. So, unfortunately, this all means that I don't know the answer to your question right off the top of my head. Are you having much luck when you Google it?
Fred Victa wrote:I'm working on an application that uses Javascript. When the user attempts to close a Web page, there is a pop-up window that comes up with two buttons: Leave this page and Stay on this page. How would I know if the user clicked on the "Leave this page" button? How would I know what the user clicked when using window.onbeforeunload?