how to insert exit popup script?

Discussion in 'HTML & Website Design' started by dzoniij, Apr 16, 2012.

  1. #1
    Hello I need exit pop script so when user want to exit from page loads second page with dialog box options - leave page or stay on page and in same time loads new page. Example is like in this site http://www.weightgainblueprint.com/buildmuscle/

    I tried to lookup that page source code and tried this code:
    <!---Exit Pop-->
    <script type="text/javascript">
    var ShowExitPopup = true;
    function ExitPage()
    {
    if (ShowExitPopup) 
    { 
    ShowExitPopup = false;
    location.href = "http://www.weightgainblueprint.com/buildmuscle/wait.php";
    return '*************************************************\nTodays Special Offer - Start Gaining Weight NOW!\n*************************************************\n\nW A I T  -  B E F O R E   Y O U   G O:\n\nCheck out my step-by-step system that reveals how I packed on 38 pounds of muscle in just 19 weeks!\n\nSimply click the *CANCEL* button below.\n\nYou can try the entire Weight Gain Blueprint system risk-free for 21-days.\n\nTo get INSTANT ACCESS to this special offer, click the CANCEL button below.\n';
    }
    } 
    </script>
    <!--End Exit Pop-->
    Code (markup):

    inserted it here - page settings- advanced setting - scripts - custom script at the bottom of the body section - no luck also tried in page itself insert like snippets still no luck...

    any advice please anyone can help?
     
    dzoniij, Apr 16, 2012 IP
  2. Basti

    Basti Active Member

    Messages:
    625
    Likes Received:
    6
    Best Answers:
    3
    Trophy Points:
    90
    #2
    Did you also added
    
    onbeforeunload="return ExitPage();"
    
    Code (markup):
    on your <body> opening tag?
     
    Basti, Apr 16, 2012 IP