Forum Moderators: open
let's say i want to display a popup when someone leaves a webpage of mine, no biggie. But what actually i want to do is if someone leaves my DOMAIN only then show popup, dont show popup if visitor has clicked on a link that leads to another page of my same domain
for example
on example.com/abc.html someone clicks on a link
example.com/p2.html
then popup shouldnt be shown but if someone clicks on a link that leads to
anyotherdomain.com/anypage.html or if they try to quit window only then show popup.
any ideas? i have an idea in which we can set value of a variable as false for insite links and in popup function could write if that variable is tru then dont show popup, but thats not what i am looking for. There are 100s of links on each page and are hundreds of dynamic pages on that site so i simply cannot change all those links to call a javascript function.
Basic Logic is
1) Call a function on body unload
2)someway or other findout if user is navigating to same site's any other page or is going offsite/closing window?
3)show popup only in second case.
Any suggestsions that could help me with Item # 2 would be really appreciated.
Regards