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

Exit PopUp Javascript with URL redirect

Discussion in 'HTML & JavaScript' started by powermix, Jun 5, 2015.

  1. powermix

    powermix Regular Member

    Joined:
    Aug 30, 2011
    Messages:
    235
    Likes Received:
    22
    Hey,

    I am trying to build a javascript code that can load on exit (when a user tries to exit either by closing the window or by going backwards).

    The javascript popup is really simple.

    I just need something where I can input a message and where I can give the user two options:

    - Stay in the page
    - Leave the page

    When the person clicks on "Leave the page" I should be able to redirect them to the URL I want.

    I have seen a lot of PopUps like these in affiliate landing pages offering coupons before the visitor leaves.

    Hope you understand what I am looking for.
     
  2. srb888

    srb888 Elite Member

    Joined:
    Jul 30, 2008
    Messages:
    3,267
    Likes Received:
    5,081
    Gender:
    Male
    Occupation:
    WebzSurfer
    Location:
    Sun, Mon, Tue, WTF, Sat!!! :)
    I can do it. See your PM for skype contact. :)

    It will cost you some fees though. So please ask the mods to move this thread to HireAFreelancer section if you wish to pay for the service. Thanks.
     
    Last edited: Jun 6, 2015
  3. powermix

    powermix Regular Member

    Joined:
    Aug 30, 2011
    Messages:
    235
    Likes Received:
    22
    I think this is something easy. I was not expecting to pay someone for 10-20 lines of code.
     
  4. srb888

    srb888 Elite Member

    Joined:
    Jul 30, 2008
    Messages:
    3,267
    Likes Received:
    5,081
    Gender:
    Male
    Occupation:
    WebzSurfer
    Location:
    Sun, Mon, Tue, WTF, Sat!!! :)
    Thanks for saying so. :)
     
  5. blackmint

    blackmint Power Member

    Joined:
    Jun 8, 2013
    Messages:
    655
    Likes Received:
    340
    Location:
    BHW
    If it is easy, then why can't you do it yourself ?
     
  6. YenSync

    YenSync Newbie

    Joined:
    Nov 23, 2011
    Messages:
    40
    Likes Received:
    117
    Occupation:
    too busy to be looking for it
    Location:
    Spain
    Home Page:
    LOL. I know some "10-20 lines of code" scripts that are worth a small fortune...
    Javascript is client-side. Just rip the script from the affiliate page source.
     
  7. powermix

    powermix Regular Member

    Joined:
    Aug 30, 2011
    Messages:
    235
    Likes Received:
    22
  8. EarthIsSmall

    EarthIsSmall Newbie

    Joined:
    Apr 26, 2015
    Messages:
    16
    Likes Received:
    3
    Something like this? Let me know if you were looking for something else.


    Code:
    [COLOR=#ffffff]<script>
    [FONT=Consolas]window.onbeforeunload = function(){   return 'Why leaving already?'; };
    </script>[/FONT][/COLOR][COLOR=#222222][FONT=Consolas]
    [/FONT][/COLOR]

     
  9. powermix

    powermix Regular Member

    Joined:
    Aug 30, 2011
    Messages:
    235
    Likes Received:
    22
    Thanks, I was looking for something a little bit complex.

    I need to have the ability to determine where the visitor goes after clicking in the PopUp buttons.