| | #1 |
| Deon Lundy Join Date: 2012 Location: Atlanta, GA
Posts: 150
Thanks: 11
Thanked 18 Times in 18 Posts
|
I need a script that will redirect users to an EXIT page before they actually exit. I tried using... <!-- Exit script --> <script language=javascript> window.onbeforeunload = function () { window.location = 'http://www.website.com/page.html'; return false; } </script> <!-- --> but for some reason even the RELATIVE links are redirecting me to the exit page. Need help Thanks |
|
Don't Give UP! See how I made mt first $69.73 online :)
| |
| |
| | #2 |
| PHP ninja War Room Member Join Date: 2011 Location: Denver
Posts: 124
Thanks: 13
Thanked 27 Times in 25 Posts
| |
|
The best path to prosperity is free market capitalism!
| |
| |
| The Following User Says Thank You to kevbo22 For This Useful Post: |
| | #3 | |
| Active Warrior War Room Member Join Date: 2013
Posts: 48
Thanks: 0
Thanked 9 Times in 9 Posts
|
| |
| |
| | #4 |
| Deon Lundy Join Date: 2012 Location: Atlanta, GA
Posts: 150
Thanks: 11
Thanked 18 Times in 18 Posts
| |
|
Don't Give UP! See how I made mt first $69.73 online :)
| |
| |
| | #5 | |
| Deon Lundy Join Date: 2012 Location: Atlanta, GA
Posts: 150
Thanks: 11
Thanked 18 Times in 18 Posts
|
That worked! Awesome! thanks everyone! Here is the CODE that I used that worked! <script language="javascript"> (function() { setTimeout(function() { var __redirect_to = 'http://www.DOMAIN.com';// var _tags = ['button', 'input', 'a'], _els, _i, _i2; for(_i in _tags) { _els = document.getElementsByTagName(_tags[_i]); for(_i2 in _els) { if((_tags[_i] == 'input' && _els[_i2].type != 'button' && _els[_i2].type != 'submit' && _els[_i2].type != 'image') || _els[_i2].target == '_blank') continue; _els[_i2].onclick = function() {window.onbeforeunload = function(){};} } } window.onbeforeunload = function() { setTimeout(function() { window.onbeforeunload = function() {}; setTimeout(function() { document.location.href = __redirect_to; }, 500); },5); return 'WAIT BEFORE YOU GO! CLICK THE *CANCEL* BUTTON RIGHT NOW! PAGE. GET YOUR FREE DISCOUNT COUPON.'; } }, 500); })(); </script> | |
|
Don't Give UP! See how I made mt first $69.73 online :)
| ||
| |
|
| Bookmarks |
| Tags |
| exit, script |
| |