I have a page that I have used the window.onbeforeunload code on. My only problem is that there is a "enlarge a photo" function used on the page that opens a little pop-up to blow up a photo. The window.onbeforeunload function works great however it wont let the pop-up window through. How can I make an exception for that enlarge() function, pop up window?
Here is what I am trying to do:
Code: Select all
if(windows is unloaded) {
if(enlarge photo function was clicked) {
do NOT display the "are you sure you want to navigate away" dialog box.
} else {
do display the "are you sure you want to navigate away" dialog box.
}
}