how to insert exit popup script?

8 replies
  • WEB DESIGN
  • |
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 FREE REPORT: Top 7 Mistakes Most Hardgainers Make Thats Keeping You Skinny...

I tried to lookup that page source code and tried this code:
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-->

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?
#exit #insert #popup #script
  • Profile picture of the author MrMike
    Hey Jay,

    Put the code before </body>
    To make this work your body tag has to have
    <body onbeforeunload="return ExitPage();" topmargin="10px" leftmargin="15px" rightmargin="15px" bottommargin="5px">

    To make sure that the exit page doesn't show up when they go forward, you need to put onClick="ShowExitPopup = false;" after all your href tags.

    Hope this make sense. Check out your sample page. You will see the body tag
    and you will see the onClick="ShowExitPopup = false;" after the aweber submit button .

    It's easy. Hope I explained it well enough.

    Mike
    {{ DiscussionBoard.errors[6072026].message }}
  • Profile picture of the author maxpine11
    It seems it is a custom post type. The plugin will only work with default post type, that is page and post. However, there's a workaround for it - you can use a plugin that will enable you to insert some codes in the footer section of every page/post. There are a lot of themes that has this feature built-in but if not there are plenty of plugins there too. So, here's the code to insert(with instructions):

    <script language="javascript">
    var exitsplashmessage = 'This is where you will put your popup message. You use \n for break space and put \ before every single quote so that it will not break the script';
    var exitsplashpage = 'http://www.REDIRECT-URL.com/';
    </script>
    <script language="javascript" src="http://www.YOUR-DOMAIN-NAME.com/wp-content/plugins/pinoy-pop-up/popup.js"></script>
    {{ DiscussionBoard.errors[6439609].message }}
  • Profile picture of the author alamest
    This is very old thread, this thread is not update and none of the scripts works..still moving around the forum to find a good exit pop up script.

    Anyway. Thanks
    {{ DiscussionBoard.errors[8696452].message }}
  • Profile picture of the author markhar
    you need to call the function to make it work. HOWEVER...

    Don't do it.

    Exit popups are A Very Bad Thing.

    To start with, there is absolutely no reason whatsoever to question if a user wantes to leave your site -- they're trying to leave. They want to leave. An exit popup is like a salesman jumping in front of you and locking the doors when you try to leave a store.

    Moreover, anything that takes control of the browser away from the user (yes, you are "hijacking" the browser) is bad - it's a security risk. Are you old enough to remember websites that have popup after popup after popup that open new windows everywhere and only lead back to the page you're trying to leave? Ever had to [ctrl-alt-delete] just to stop reading about weight gain powder?

    This sort of thing is too often abused. Fortunately, modern browsers are staring to ignore scripts like this. When I come across a site that does this, I leave and never come back -- even if I was interested in the first place, and planning to come back later. Please, think twice.
    {{ DiscussionBoard.errors[8696721].message }}
  • Profile picture of the author topnichewebsites
    I have an exit script that works in all 3 browsers if you really want one. PM me.
    Signature
    http://pixelcovers.com/ <- eBook add eCovers

    https://www.unicommercesolutions.com <- WordPress Websites and Maintenance
    {{ DiscussionBoard.errors[8697775].message }}
    • Profile picture of the author Crankin38
      Originally Posted by topnichewebsites View Post

      I have an exit script that works in all 3 browsers if you really want one. PM me.
      Top Niche,
      I could really use some help with this. I don't think I have enough posts to send a PM, so I am trying to contact you here.

      I have tried a few different scripts, but some work, and some don't.
      The one I have used that seems to work well, doesn't work in IE???

      I am wearing out on this. Any help would be extremely appreciated.
      Thanks,
      Craig
      {{ DiscussionBoard.errors[8715673].message }}
  • Profile picture of the author sk8tavou
    I think there are numerous exit pop up plugins for wordpress.
    Used to have one but i don't remember the name.

    A simple google search will give you ton of ideas!
    Signature
    SocialWarrior - Cheapest Social Marketing Services
    Just message me for greater discounts :)
    {{ DiscussionBoard.errors[8697834].message }}
  • Profile picture of the author topnichewebsites
    crankin38 contact me at sales@topnichewebsites.net
    Signature
    http://pixelcovers.com/ <- eBook add eCovers

    https://www.unicommercesolutions.com <- WordPress Websites and Maintenance
    {{ DiscussionBoard.errors[8716503].message }}

Trending Topics