Let me tell what I need to do.
I want to popup a window for vistors leaving my website.
I set a flag in the beginning, and when the visitor leaves page, the unload event is called, I check the flag and if it is set, I popup a page. If the visitor clicks on links within my website, I use the onclick event to turn off the flag so that there is no popup by the onunload event.
But when the visitor reloads the page, there will be a popup. Is there any workaround for this?
How do I prevent the popups on reloading?