Disabling Exit Alerts

Deliguy

New member
Sep 27, 2006
5,162
195
0
Oregon
Ya know how a lot of offers and landers have exit alerts that confirm if the person wants to leave the page? I have one that does that and forwards them to the first of two offers at the same time. I was wonder if there is a way to disable the javascript that does it if they're clicking on one of the affiliate links in the salescopy.

Here's the code i have at the bottom right before the </body> tag

Code:
<script type="text/javascript" language="javascript">
var areYouReallySure = false;
var internalLink = false;
function areYouSure() {
if (!areYouReallySure && !internalLink) {
areYouReallySure = true;
location.href="http://firstoffer.here.com"
return "*****************************************************\n\nWait! \n\nBefore you leave , please take a look at this limited time offer.!\n\nClick cancel to stay on this page\n\n*****************************************************";
}
}
window.onbeforeunload = areYouSure;
</script>

Any help is much appreciated :)
 


You can do this with unobtrusive javascript if you wish, but here is the jist:

Code:
<a href="http://noaff.com">not an aff</a>

<a href="http://aff.com/me?id=money" onclick="window.onbeforeunload=null;">Aff program</a>
 
Lead Saver lets you specify rules to disable it, basically, when you're applying the onbeforeunload function, don't apply it to certain links.

Edit: oh, you're applying it sitewide. Then the above poster is right.
 
You can do this with unobtrusive javascript if you wish, but here is the jist:

Code:
<a href="http://noaff.com">not an aff</a>

<a href="http://aff.com/me?id=money" onclick="window.onbeforeunload=null;">Aff program</a>
Thanks a lot was looking for this