Exit PopUp Javascript with URL redirect

powermix

Regular Member
Joined
Aug 30, 2011
Messages
391
Reaction score
57
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.
 
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:
I think this is something easy. I was not expecting to pay someone for 10-20 lines of code.
 
I think this is something easy. I was not expecting to pay someone for 10-20 lines of code.

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.
 
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.

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]

 
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]


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.
 
Back
Top