code to prevent exit pop-up on internal links

Discussion in 'HTML & Website Design' started by lsargent, Aug 19, 2009.

  1. #1
    The exit pop-up script I have is working fine, other than the fact that it engages on any internal links as well.

    I know that there is either a code that can be applied universally, or a code I can put in every link that will prevent this from happening.

    Not sure that it matters, but I've included the exit script below. Any help on which code to use and where to place it in my page would be a big help.

    Thanks

    
    <script type="text/javascript">
    var internal = 0;
    function bunload() {
    if (internal != 1) {
      window.onbeforeunload = null;
      alert("******************************************************\n WAIT!  WAIT!  WAIT!  WAIT!  WAIT!  WAIT!!  WAIT!!\n******************************************************\n\nMy partner will probably KICK MY ASS for this...\n\nI am secretly giving away a LIMITED number of $20\ncoupons just for Tweeting about us.\n\nIf you act right now, you can grab our Manuscript\nplus ALL Bonuses for just $27!\n\nJust click *CANCEL* on the next window to get your\nV.I.P. discount link!\n\n******************************************************");
      window.location = "gift page";
      return "******************************************************\n  Click CANCEL  -  Click CANCEL  -  Click CANCEL  \n******************************************************\n\n  Click *CANCEL* Now to get your V.I.P. discount!\n\n"; }
    else {
      internal = 0;
           }
    }
    if (internal != 1) {
       window.onbeforeunload = bunload;
    }
       else {
       internal = 0;
    }
    </script>
    
    Code (markup):
     
    lsargent, Aug 19, 2009 IP
  2. backlinkgurus

    backlinkgurus Guest

    Messages:
    67
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    These popups make we want to shoot myself.
     
    backlinkgurus, Aug 19, 2009 IP
  3. lsargent

    lsargent Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    me too, but they convert well enough to still use them :)
     
    lsargent, Aug 19, 2009 IP