![]() |
Exit popup code needed
Hey folks hoping you can give me a hand. Programmer here says it is impossible to do, and I am pretty sure he's wrong so let's embarrass him a bit ;)
I need some code that will launch an exit ONLY if the browser has been closed or the domain has been left. So they go to www.xxx.com and then go to www.www.com, they would get it. I don't want it to launch if they go from the index page to another page on the site. Anyone know of anything? I googled but nothing exactly like this. Thanks! :thumbsup |
do a sneeky popunder :)
|
I'd 2 have that code also, when they leave the domain...
|
hahahahahahahaha LANGUAGE="hahahahahahahahahaha">
var goneaway; function showPopup() { if( goneaway ) { NewWindow=windowhahahahahaha("http://www.yoursiteexitpopup.com"); } } </hahahahahahahaha </head> <body bgcolor="FFE9B8" topmargin="0" marginheight="0" hahahahahahahaha"goneaway=true" ONUNLOAD="showPopup();"> make sure you add the onclick false on every link you DONT want the exit to popup : <a href="members/pictures.php" ONCLICK="goneaway=false;"> |
that looks cool :) drop me a line to get the code ok bob AT thinkx DOT tv
|
Thanks Bob, emailing you now!
|
Your programmer said that's impossible?
|
That looks like a normal exit popup code. If I go from index to page 1 then back button, it'll pop even if I'm on the same domain.
Or, if that code is only on index, and I go to page 1 then close browser, it wont pop. I dont think thats the answer you're looking for, but I may be just sleepy. |
Quote:
|
Quote:
|
Bump. Thanks to Bob for the code but it's not exactly what I need. This one is a bit flawed... having to add the onclick to all links is not really an option.
I'm going to keep hunting too. |
Just thinking out loud here.
If you want to pop a window when a browser is trying to *leave* a domain, you'd have to be examining the URI that is being requested, and before it's displayed. That is, IF currently on mydomain AND IF new action will exit mydomain, THEN pop. So you cant really examine the current state, you'd have to examine a future state when a link or button is clicked. You could probably do a custom mod_rewrite script. Use the rewriterule to pass the request_uri as a query_string to the script, then do an IF THEN ELSE type of thing.. There ya go, lol |
lol Tom I haven't touched any sort of scripting in a long ass time. You ALMOST lost me.
The question is... do I feel like programming. ;) |
Hmm actually I doubt that would cover it anyway, lol. Like I said just thinking out loud.
If you were to click a link off your domain, your htaccess wouldnt kick in anyway. Maybe you can use php or a cookie, I dunno. |
In your header you put this:
hahahahahahahaha language="hahahahahahahahahaha"> <!-- var exit=true; function xit() { if (exit) open("http://www..com","copy"); } //--> </hahahahahahahaha Then in the body tag put this: onunload="xit()" Then on every other link that you don't want to pop that window you add : onclick="exit=false Very simplified way to do this: :thumbsup Ivy |
Quote:
Ivy |
I spammed devshed. Maybe someone there will know
|
bumpppp
|
It's been awhile since I've had to do this but . . .
If memory serves, you can frame your site leaving a 1 pixel top frame which ensures that the popup code will not launch until they actually leave the site or close the browser. Of course, far fewer people actually see popups anymore with all the blockers out there and Microsoft's update to IE is just around the corner. |
:banana
|
Check some java script tutorial something like that:
http://www.webteacher.com/hahahahaha...aha/index.html |
Yeah the 1px frame isn't an option due to SEO. But that was the first thing I thought of. :)
|
Quote:
|
Quote:
|
Quote:
|
Uh.... just make your index page a frameset with a hidden frame and a 100% visible frame. Load your site in the 100% visible frame, load your popup code in the hidden frame, and there ya go. :)
Checkout http://www.valmalone.com/ for an example of how to do this. I ICQed you in case you miss this reply... |
fire your programmer
that code with onexit and co has been around since day 1 of the internet |
I have to ask...
Why is that not an option? As far as I know it's the only way... But, why is it not an option? If you have a ton of links to edit, you do an edit/replace and it's really easy (tedious, but easy). |
Quote:
|
All times are GMT -7. The time now is 01:21 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123