jwwceo Posted December 18, 2007 Share Posted December 18, 2007 I should probably get some sort of rookie hazing for this question, but here goes. I'm trying to create an exit-survey upon leaving my site -- a pop-up that appears when someone leaves. I've looked on the net for a tutorial, but so far no luck. Any ideas? Quote Link to comment Share on other sites More sharing options...
btherl Posted December 18, 2007 Share Posted December 18, 2007 This may help .. popup blockers will probably stop this though. Quote Link to comment Share on other sites More sharing options...
jwwceo Posted December 18, 2007 Author Share Posted December 18, 2007 Thanks guru, I had seen that one before, but I was looking for one that opened only when you left the site - as opposed to just leaving the page where the script is. (They may surf to another internal page - at that point I don't want the script to run) Has anyone seen anything out there for that? Quote Link to comment Share on other sites More sharing options...
btherl Posted December 19, 2007 Share Posted December 19, 2007 Oh yes .. you're right. There's a way to do it though: http://www.webmasterworld.com/forum21/1268.htm I have seen this implemented by a domain parking company. You can see a sample of how it works at http://www.checkorderexpress.com (you must look in the frames, the main page is just a frame set). The variable that controls it is doPop, and it is set to 0 by all internal links. Then the onunload action checks that variable each time. If it wasn't set to 0 (indicating internal link), then the popup is popped. This may be a problem if someone has multiple windows of your site open and closes one of them. I don't know how to deal with that situation. Quote Link to comment Share on other sites More sharing options...
jwwceo Posted December 19, 2007 Author Share Posted December 19, 2007 Thanks btherl, that looks like exactly what I'm trying for... cant seem to get this silly onUnload function to work: <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#FFFFFF" background="/images/background.gif" onUnload="Open4('/stitching.php')"> ... i hate onunload Quote Link to comment Share on other sites More sharing options...
btherl Posted December 20, 2007 Share Posted December 20, 2007 does an onunload="alert('the page is closing, abandon ship!')" work? Quote Link to comment Share on other sites More sharing options...
jwwceo Posted December 20, 2007 Author Share Posted December 20, 2007 well, I'm trying to open up a little window with a short survey that gets sent back to me... hence the open function, but for some reason it's not opening anything. Any thoughts? Quote Link to comment Share on other sites More sharing options...
btherl Posted December 20, 2007 Share Posted December 20, 2007 What I'm asking is if the problem is that onunload is not running, or if the problem is in your Open4() function. You can determine which of the two it is by trying an alert instead of Open4(). Quote Link to comment Share on other sites More sharing options...
jwwceo Posted December 26, 2007 Author Share Posted December 26, 2007 i'm with you... sat down with it for a minute and realized that i was doing something stupid, corrected it, and now it works. Thanks for the help... it is much appreciated! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.