Exit Pop Up Script Pops Up When User Hits "Join Now" ...HELP!

14 replies
  • WEB DESIGN
  • |
Hello everyone.

I just got into building landing pages recently and I have been trying to get this exit pop up script to work properly for days. It works fine in Google Chrome, however when I go in Internet Explorer and hit the "Join Now" button on my landing page ... it still pops up.

Here is the code:

<script language="javascript">
var PreventExitPop = true;
function ExitPop() {
if(PreventExitPop != false) {
return "WAIT! \n\nSOMETEXT \n\n"
}
}
window.onbeforeunload = ExitPop;
</script>

What can I add to this code to make it only pop up when a user tries to click out?

Any help is APPRECIATED!

Thank you in advance....
#exit #hits #join now #pop #pops #script #user
  • Profile picture of the author newbim
    I posted this for my first share. Hope it helps.
    http://www.warriorforum.com/website-...free-code.html .

    (I'm not good with JavaScript so sorry I can't dissect what you have written.)
    Signature
    If what I said helps, let me know, throw me a 'thanks'.
    {{ DiscussionBoard.errors[7891702].message }}
  • Profile picture of the author rekerlolz
    Originally Posted by newbim View Post

    (I'm not good with JavaScript so sorry I can't dissect what you have written.)
    Thanks for the find

    Do you know if it possible to add a redirect to the script so when a person chooses to leave the page they are redirected to another page?
    {{ DiscussionBoard.errors[7891781].message }}
  • Profile picture of the author rekerlolz
    Nvm question answered. Thanks!
    {{ DiscussionBoard.errors[7891797].message }}
  • Profile picture of the author rekerlolz
    I take that back. Actually ... the code is still giving me the same problem that I had with the original code I was using.

    In Internet Explorer the exit pop up still happens when any of the links on the page are clicked. When someone goes to sign up they are greeted with an exit pop up instead of being directed to the offer page.

    I even used this piece of code on all of the links that I didn't want the pop up to happen on.

    ‘onClick=”isExit = false;”

    just as he says in the directions ... but it still isn't preventing the pop up from happening on my links to my offer.

    Help!
    {{ DiscussionBoard.errors[7891874].message }}
    • Profile picture of the author ttkim
      It would be much easier to help if you provided a link or something to see the source code.
      {{ DiscussionBoard.errors[7892004].message }}
  • Profile picture of the author rekerlolz
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"><head>


    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Divorced Men Under 5'8 In High Demand</title>



    <link href="./Mature%20Dating%20Only_files/rms.css" rel="stylesheet" type="text/css" />

    </head><body onBeforeUnload="return ExitPage();">
    <div class="wrapper">
    <div class="logo"></div>
    <div class="banner"> <a href="signup.php" 'onClick="isExit = false;"><img src="Mature Dating Only_files/top-banner.png" alt="b" height="111" style="border: 0px solid ; width: 980px; height: 111px;" /></a> </div>
    <div class="button"> <a href="signup.php" 'onClick="isExit = false;"><img src="Mature Dating Only_files/button1.png" border="0" /></a> </div>
    <div class="arrow"> <a href="signup.php" 'onClick="isExit = false;"><img src="./Mature%20Dating%20Only_files/arrow.png" border="0" /></a> </div>
    <div class="search"> <span style="font-weight: bold; font-size: 16px;">High Demand: <u>Divorced Men With Children</u> in <big style="color: rgb(51, 102, 255);">
    <script language="JavaScript" src="http://j.maxmind.com/app/geoip.js">
    <script language="JavaScript">document.write(geoip_city()) ;</script>
    <script language="JavaScript">document.write(geoip_city()) ;</script></big></span><br />
    <span style="font-weight: normal; font-size: 14px;">
    Here Is A Sample Of The (<span style="font-weight: bold;">8</span>) Out
    Of (<span style="font-weight: bold;">2,918</span>) Women In Your Area <br />
    SOME TEXT: </span></div>
    <div class="arrow"> <a href="signup.php" 'onClick="isExit = false;"><img src="./Mature%20Dating%20Only_files/arrow.png" border="0" /></a> </div>
    <div class="info">
    <p><br />
    <span style="font-weight: bold; font-size: 13px;">Sally2Sweety</span><br />
    Seeking: Male Age 40+<br />
    Location:
    <script language="JavaScript">document.write(geoip_city()) ;</script>
    <br />
    <a href="signup.php" onclick="exit=false">Meet
    This Match</a><br />
    <br />
    <br />
    <br />
    <br />
    <span style="font-weight: bold; font-size: 13px;">Candyluv</span><br />
    Seeking: Male Age 40+<br />
    Location:
    <script language="JavaScript">document.write(geoip_city()) ;</script>
    <br />
    <a href="signup.php" 'onClick="isExit = false;">Meet
    This Match
    </a><br />
    <br />
    <br />
    <br />
    <span style="font-weight: bold; font-size: 13px;">LoveLife23</span><br />
    Seeking: Male Age 40+<br />
    Location:
    <script language="JavaScript">document.write(geoip_city()) ;</script>
    <br />
    <a href="signup.php" 'onClick="isExit = false;">Meet
    This Match
    </a><br />
    <br />
    <br />
    <br />
    <span style="font-weight: bold; font-size: 13px;">MsSweetum</span><br />
    Seeking: Male Age 40+<br />
    Location:
    <script language="JavaScript">document.write(geoip_city()) ;</script>
    <br />
    <a href="signup.php" 'onClick="isExit = false;">Meet
    This Match
    </a><br />
    <br />
    <br />
    <br />
    <br />
    </p>
    </div>
    <div class="info2"><br />
    <span style="font-weight: bold; font-size: 13px;">Jamie_P</span><br />
    Seeking: Male Age 40+<br />
    Location:
    <script language="JavaScript">document.write(geoip_city()) ;</script><br />
    <a href="signup.php" 'onClick="isExit = false;">Meet
    This Match
    </a><br />
    <br />
    <br />
    <br />
    <br />
    <span style="font-weight: bold; font-size: 13px;">ShortNSweet</span><br />
    Seeking: <span class="info"> </span>Male Age 40+ <br />
    Location:
    <script language="JavaScript">document.write(geoip_city()) ;</script><br />
    <a href="signup.php" 'onClick="isExit = false;">Meet
    This Match
    </a><br />
    <br />
    <br />
    <br />
    <span style="font-weight: bold; font-size: 13px;">Artlook64</span><br />
    Seeking: <span class="info"> </span>Male Age 40+<br />
    Location:
    <script language="JavaScript">document.write(geoip_city()) ;</script><br />
    <a href="signup.php" 'onClick="isExit = false;">Meet This Match
    </a><br />
    <br />
    <br />
    <br />
    <span style="font-weight: bold; font-size: 13px;">PrincessTiff</span><br />
    Seeking: Male Age 40+<br />
    Location:
    <script language="JavaScript">document.write(geoip_city()) ;</script><br />
    <a href="signup.php" 'onClick="isExit = false;">Meet
    This Match
    </a><br />
    <br />
    <br />
    </div>
    <div class="pic">
    <br />
    <a href="signup.php" onclick="exit=false">
    </a><a href="signup.php" onclick="exit=false"><img src="./Mature Dating Only_files/1.png" border="0" /></a><br />
    <br />
    <a href="signup.php" 'onClick="isExit = false;"><img src="./Mature Dating Only_files/2.png" border="0" /></a><br />
    <br />
    <a href="signup.php" 'onClick="isExit = false;"><img src="./Mature Dating Only_files/9.jpg" border="0" /></a><br />
    <br />
    <a href="signup.php" 'onClick="isExit = false;"><img src="./Mature Dating Only_files/7.jpg" border="0" /></a><br />
    <br />
    </div>
    <div class="pic2"> <br />
    <a href="signup.php" 'onClick="isExit = false;"><img src="./Mature Dating Only_files/8.jpg" border="0" /></a><br />
    <br />
    <a href="signup.php" 'onClick="isExit = false;"><img src="./Mature Dating Only_files/thumb38.jpg" border="0" /></a><br />
    <br />
    <a href="signup.php" 'onClick="isExit = false;"><img src="./Mature Dating Only_files/11.jpg" border="0" /></a><br />
    <br />
    <a href="signup.php" 'onClick="isExit = false;"><img src="./Mature Dating Only_files/12.jpg" border="0" /></a><br />
    <br />
    </div>
    <div class="secure"> <img src="./Mature%20Dating%20Only_files/mcafee.jpg" border="0" /><br />
    <br />
    </div>
    <div class="text"> <br />
    <span style="font-weight: bold; font-size: 13px;"><u>What
    our members have been saying about FortyPlus Singles:</u> </span> </div>
    <div class="text2"> <span style="font-size: 12px;"><br />
    <i>". I met my wife on the site last
    Fall and we got
    married this Summer! I couldn't be happier right now."</i><b> -Sam
    Olsted </b></span> </div>
    <div class="text3"> <span style="font-size: 12px;"><br />
    <i>"I have yet to
    find a better dating service than SOME TEXT Their screening
    process makes it so you only meet women you click with" </i><b>-Dennis G</b> </span> </div>
    <!-- <div class="testimonial1">
    <img src="Images/testimonial1.png" border = 0/></a><br /><br />
    </div>

    <div class="testimonial2">
    <img src="Images/testimonial2.png" border = 0/></a><br /><br />
    </div> -->
    <div class="bottombar"> <img src="./Mature%20Dating%20Only_files/bottombar.png" border="0" /> </div>
    <div class="bottomrightimage"> <img src="./Mature%20Dating%20Only_files/text.png" border="0" /> </div>
    <div class="expires"> <span style="font-weight: bold; font-size: 32px;">Don't
    Miss Out! </span><br />
    <span style="font-weight: bold; font-size: 18px;">Offer Expires: 11:59 P.M. on</span> <span style="font-weight: bold; font-size: 22px; color: red;">
    <script language="Javascript">
    <!--

    // Array of day names
    var dayNames = new Array("Sunday","Monday","Tuesday","Wednesday",
    "Thursday","Friday","Saturday");

    // Array of month Names
    var monthNames = new Array(
    "January","February","March","April","May","June", "July",
    "August","September","October","November","Decembe r");

    var now = new Date();
    document.write(dayNames[now.getDay()] + ", " +
    monthNames[now.getMonth()] + " " +
    now.getDate() + ", " + now.getFullYear());

    // -->
    </script></span> </div>
    </div>


    <script language="javascript">
    var PreventExitPop = true;
    function ExitPop() {
    if(PreventExitPop != false) {
    return "WAIT! \n\nWe are the most exclusive dating website for big beautiful singles like you and have limited sign-ups for females in . \n\nJoin NOW via this special offer while spots are still avaliable! Don't leave love up to chance! \n\n"
    }
    }
    window.onbeforeunload = ExitPop;
    </script>

    </body></html>


    __________________________________________________ _________________________



    The funny thing is that it works fine in chrome, but when I go over to internet explorer it starts giving me trouble.
    {{ DiscussionBoard.errors[7892096].message }}
  • Profile picture of the author ttkim
    I'm not sure how that is working on Chrome on your computer. That code doesn't work for me. There's also a lot of things in that code that you can improve on...

    Code:
    <a href="signup.php" 'onClick="isExit = false;">SOME TEXT</a>
    That code doesn't work because..

    1. There is the apostrophe right before the onclick. I'm not sure what that's doing there.
    2. Where is this isExit boolean coming from? I don't see it in your script.

    This is what I would do.

    Code:
    <a href="signup.php" onclick="preventPopUp()">SOME TEXT</a>
    Whenever you click it, call a function called "preventPopUp". After that, add this to your script:

    Code:
    function preventPopUp() {
    	PreventExitPop = false;
    }
    What the function does is change PreventExitPop to false.
    {{ DiscussionBoard.errors[7892154].message }}
    • Profile picture of the author rekerlolz
      Thanks a bunch for your help. I just grabbed this code out of some random forums so I wasn't sure how good it was or not.

      Where exactly do I place this code in my source?

      function preventPopUp() {
      PreventExitPop = false;
      }
      {{ DiscussionBoard.errors[7892199].message }}
  • Profile picture of the author ttkim
    Just put it in between the script tags that you have.

    Code:
    <script language="javascript">
    var PreventExitPop = true;
    function preventPopUp() {
        PreventExitPop = false;
    }
    function ExitPop() {
    if(PreventExitPop != false)	{
    return "WAIT! blablabla";
    }
    }
    window.onbeforeunload = ExitPop;
    </script>
    {{ DiscussionBoard.errors[7892212].message }}
    • Profile picture of the author rekerlolz
      Originally Posted by ttkim View Post

      Just put it in between the script tags that you have.

      Code:
      <script language="javascript">
      var PreventExitPop = true;
      function preventPopUp() {
          PreventExitPop = false;
      }
      function ExitPop() {
      if(PreventExitPop != false)	{
      return "WAIT! blablabla";
      }
      }
      window.onbeforeunload = ExitPop;
      </script>

      Looks like it's working now. Your a smart one . I really appreciate you taking your time to help me out with this.

      I am curious .... but do you know how to add a redirect to the script so when someone clicks on the leave page button they are redirected to another landing page?
      {{ DiscussionBoard.errors[7894523].message }}
  • Profile picture of the author ttkim
    I don't really get your question. Lets say someone wants to go to Google so he/she types in google.com. They get the message "Wait!" message. If they click leave page, they should be taken to Google. Why would you redirect them somewhere else?
    {{ DiscussionBoard.errors[7894658].message }}
    • Profile picture of the author rekerlolz
      Originally Posted by ttkim View Post

      I don't really get your question. Lets say someone wants to go to Google so he/she types in google.com. They get the message "Wait!" message. If they click leave page, they should be taken to Google. Why would you redirect them somewhere else?
      I guess I would like to have the traffic I am paying for go through as much of my sales funnel as possible before they are out of my reach.

      That's what exit splash does, however exit splash cost $67.

      You can send your traffic to another offer if they choose to opt out of the 1st landing page ... which in essence is getting more bang for your buck with paid traffic.
      {{ DiscussionBoard.errors[7894787].message }}
      • Profile picture of the author Michael71
        Only if the user clicks NOT on "Leave Page" or "Cancel"... then they can get redirected to a NEW page.

        If they decide to leave your page there is NOTHING you can do about it.

        And even if you could redirect them against their will. This "tactic" is really a bad one.

        Besides that, the script from http://www.exitsplash.com is from 2010... come on. Tons of tutorials and free scripts out there.

        Originally Posted by rekerlolz View Post

        I guess I would like to have the traffic I am paying for go through as much of my sales funnel as possible before they are out of my reach.

        That's what exit splash does, however exit splash cost $67.

        You can send your traffic to another offer if they choose to opt out of the 1st landing page ... which in essence is getting more bang for your buck with paid traffic.
        Signature

        HTML/CSS/jQuery/ZURB Foundation/Twitter Bootstrap/Wordpress/Frontend Performance Optimizing
        ---
        Need HTML/CSS help? Skype: microcosmic - Test Your Responsive Design - InternetCookies.eu

        {{ DiscussionBoard.errors[7894843].message }}
        • Profile picture of the author rekerlolz
          Originally Posted by Michael71 View Post

          Only if the user clicks NOT on "Leave Page" or "Cancel"... then they can get redirected to a NEW page.

          If they decide to leave your page there is NOTHING you can do about it.

          And even if you could redirect them against their will. This "tactic" is really a bad one.

          Besides that, the script from http://www.exitsplash.com is from 2010... come on. Tons of tutorials and free scripts out there.
          I suppose you are right.

          Was just wondering what the deal was anyways.

          I saw your SIG ... I am going to PM you with a question!
          {{ DiscussionBoard.errors[7895027].message }}

Trending Topics