1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Need exit pop up script

Discussion in 'HTML & JavaScript' started by lawnsa23, Mar 5, 2016.

  1. lawnsa23

    lawnsa23 Newbie

    Joined:
    Mar 5, 2016
    Messages:
    15
    Likes Received:
    0
    Hi, i'm looking for a pop up script that can pop up my affiliate page when a person exits out of my site. I've heard most browsers nowdays block it so i don't know if pop ups like this even exist anymore. Would anyone happen to know of a script that can do this? Thanks
     
  2. futureman89

    futureman89 Newbie

    Joined:
    Mar 15, 2016
    Messages:
    4
    Likes Received:
    0
    Home Page:
    if you using wordpress, i suggest you a flugin can do this: Pinoy Pop-up on Exit
    if you dont use wp, use this code

    Code:
    function goodbye(e) {
        if(!e) e = window.event;
        //e.cancelBubble is supported by IE - this will kill the bubbling process.
        e.cancelBubble = true;
        e.returnValue = 'You sure you want to leave?'; //This is displayed on the dialog
    
        //e.stopPropagation works in Firefox.
        if (e.stopPropagation) {
            e.stopPropagation();
            e.preventDefault();
        }
    }
    window.onbeforeunload=goodbye;