Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

When leaving webSITE load certain page

Status
Not open for further replies.

adelante

Programmer
May 26, 2005
82
DK
Is it possible to load/redirect to a certain webpage when you leave a website??

I got this website and would like to make a small survey, to appear when you leave it - no matter what page people are on. Just for a week or so, so that it doesn't get too annoying.

So: people arrive to my site, click around, and either close the window or click back to google or whatever - and then:
- either popup the survey in a new window (if possible a window that wont be caught by those popup filters)
- or load this survey somehow in the same window?

Is any of this possible??

Thanks!!
 
I know it can be really annoying, but in my case I really need it. And it's only for a week, so I think it would be ok.

Is there a script somewhere? copy/paste

I have only managed to find scripts that makes a window popup after EACH webpage, and THAT's annoying!! :eek:)

I only want the surveypage to load when leaving the entire site/domain. Either by closing the window or hitting the back button, back to whatever link people followed to my site.
 
Rather than build in this annoying feature, why not provide a simple (but clear) link to the survey? There is no way most users will fall for stunts like that! If I get a popup that forces it's way onto my browser I'll close it without hesitation, and make a note not to visit the site again.

Please don't use or promote this type of behaviour.

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Why do you NEED to annoy your website's visitors for a week? Do you want them to come back NEXT week or not?

When you come to TekTips with a question, you will often get advice beyond the mechanical how-to in doing something. Those who answer questions here are responsible for tens of thousands of web pages (maybe that's a low estimate, too). You'll get good advice from some, bad advice from some, but if you get the same advice from several (especially those on the MVP list on the right side of the screen), you're getting the advice of much experience.

If you have something I REALLY want or need that I can't get anywhere else, I am willing to put up with just closing the window with the survey. I ran into a popup survey at HP's website the other day going after the latest device drivers. It popped up when I went to a certain page, though, not when I left the site. They can get away with it because they offer things that can't be as easily obtained anywhere else.

If you want to take a survey, put a link to it on your checkout page or some other common page people will get to in the process of visiting your site.

Lee
 
come on guys, I know where you are all coming from but sometimes, I see a question asked like this all the time and the reply is always the same 'SHOULD' you be doing this?

if it can be done tell us 'HOW' , not the moralities of whether it should or shouldn't be acording to the gospel of luke!

I had to do this feature for my members area, I needed to log them out when the browser was closed regardless, and was finding onunload was no good to open a window because popup blockers kept blocking the window.

I used to force out reg keys to all members that allowed me to open the browser in full screen so there was no [x] to click and so they had to click the logout button, but this sometimes caused problems when third party sites that made up part of the members area

They had programmers who didn't use the window.open command with attributes, and so the browser defaulted to the last know window type - which was full screen and left the user with a PDF in full screen, no menu options or toolbar and no way to close it - not good.

I actually ended up utilising AJAX with the onunload, firing an AJAX request to log them out and throwing up an alert box telling them a popup blocker had blocked the logout window, giving the ajax time to run before the window completely closed when the ok button was pressed.

This works well and resolved my issue, but if there was a way to ensure the logout code ran and diplayed the logout succesfull message, i'd very much appreciate someone sharing the answer.

I've seen sites, where I have closed the window but it just seems to redirect to another site instead of closing and so beats the popup blockers, I just don't know how to do it.

It's not always whether you should or shouldn't do something, it's what you do with it that counts.

If I force a new page to open regardless of popup blockers, to ensure that the logout is successfull , that is not a bad thing to do!

If my boss tells me that I must enforce EVERY member whether they like it or not to see an advert, then it MUST be done. If they tell me to force everyone to complete a survey, then it must be done.

The moralities of web standards is irrelevant, this is not a joe public site it is an industry B2B members compulsary under Financial Services Authority compliance website.

Standard web practices do not always function in a company intranet application environment.

well there's my 2p on the matter - lol










"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
This doesn't appear to fit most of the criteria you worked with, 1DMF. It's a site that people come to while browsing the Internet, maybe from Google, which pretty much rules out a site where someone is logged into a members-only area and needs to be logged out, or an intranet site/application environment.

Lee
 
fair dinkum!

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top