INeedAGig Posted February 12, 2012 Share Posted February 12, 2012 Hey there guys, I'm in need of a little bit of help. What would be the best way to have a new window/tab open upon a user clicking the exit button for the window/tab they are in? Thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/256938-open-new-window-upon-page-exit/ Share on other sites More sharing options...
Adam Posted February 13, 2012 Share Posted February 13, 2012 There's nothing more frustrating that a website could do than open a new window as I'm trying to leave. If this is for advertising or a last ditch attempt to keep the user on the site, then steer clear. It will have the opposite effect and just annoy the user. If there's a genuine, helpful reason then you could use the "onunload" event. Be aware though, the "onunload" event is frequently abused and browsers are weary of what you try to do at that point. Quote Link to comment https://forums.phpfreaks.com/topic/256938-open-new-window-upon-page-exit/#findComment-1317511 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.