Results 1 to 5 of 5

Thread: Trouble with an exit popup.

  1. #1
    Join Date
    Jan 2009
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Trouble with an exit popup.

    So after hours and hours of searching and testing, I finally got a decent exit popup, however, it just doesn't quite do it all.

    Basically:
    I want to create a script for my website which gives an exit popup that asks if they'd like to fill out a survey to see why they didn't buy any products.

    The problem is that there are so many links that an unLoad script wouldn't work if I'd have to go back through every link to change it for it.

    The other problem is that a mapped out area wouldn't work because them hitting the back button isn't a bad thing when they are browsing the site.

    The final problem is that the cart is on a seperate server, and brings them to a new page, which would trigger the popup as well.

    I'd only want it to pop up if they didn't buy anything, and only once. So I guess either IP based or cookies enabled.

    The current script kinda works fine enough, however, basic pop up blockers will stop it.

    Possible ideas?

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,156
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    The only way to be sure that the popup will appear is using an event for when the page is closed. The only way, then, to make it NOT appear when the page is closed, for any reason, is to make any except for everything that is either still on your site [you could have javascript parse the url of the link clicked], on the other site[again, and allow the second domain too], and if the IP has already had the popup [use ajax to check with the server for the IPs entry in a database, or I guess you could use a cookie, though that is not particularly reliable and it won't last forever]. That's a lot of work, very complex, and not entirely reliable.
    Finally, a popup is not something you can force-- popup blockers are meant to block them, and that's not something you can work around.
    Generally, attempting to stop the user from doing something they want to do is a bad idea, and that's the case here.
    I'd say that if your script "kinda works" then that's probably good, considering.

    Nearly everything on the web is designed to happen when you LOAD a page, not when you close it, and so you're basically going against the current here.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. The Following User Says Thank You to djr33 For This Useful Post:

    Droogie (01-12-2009)

  4. #3
    Join Date
    Jan 2009
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the info.

  5. #4
    Join Date
    Dec 2008
    Location
    Nigeria
    Posts
    95
    Thanks
    3
    Thanked 8 Times in 8 Posts

    Default

    I did something like this some years back on IE - not sure if it will apply here (or if will work in all browsers) - the site hompage will popout a window immediately the site loads, the window will then be moved by jscript moveTo fx to a negative - outside the view of the user like moveTo(-1000,0); - that window will now use the opener method to set a reference on the window that launched your site and will now use a setTimeout to monitor that window by parsing the url to see if the browser is still on your site - when the browser leaves your site - it can now reposition itself at the center of the screen so that the user can now see the survey form.

    That is about the only solution i can come up with at the moment.

  6. #5
    Join Date
    Jan 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ive been looking for this script exit popup can someone show the codes? need to pop up a page when someone exit the page it says wait before you leave.....

    thanks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •