Hi: I have a one-page salesletter website and an accompanying order page. I want a popup to appear only if the visitor leaves both pages.
In other words, I’m trying to have the popup appear only if a visitor to page A closes page A except if the visitor goes to page B (going to page B closes page A and brings up the popup, but I don’t want that yet). Then if that visitor closes page B, I want the same popup to appear unless the visitor is returning to page A.
Here’s the logic that I think would work:
Script on page A:
if leaving current page AND NOT loading page B
then popup the following window [onunload="javascript:PopupMe()"]
Script on page B:
if leaving current page AND NOT loading page A
then popup the following window [onunload="javascript:PopupMe()"]
Is there a javascript I can use to accomplish this?
Thanks!
--Gabriel