We currently have a JS that popups a window whenever the visitor wants to leave the site. It works fine, except when hitting the back button on the browser, it popups up the alert even if we are on the site.
we want to fix this.
-we do not want to disable the back button
-we do not want to erase the historial
the JS function is onbeforeunload.
it is currently loading everytime the user wants to leave the site. When the user navigates the site, on every link that we DO NOT want to trigger the popup, we add this: onClick="changes=true;" to the href.
As I mentioned, problem is when user hits back button, FWD and sometimes refresh.
here is the website url link text