Yes and no...
You *can* use <body onUnload="..."> to ask the person if they *really* want to leave this page, but you can't stop them from doing so if they say "yes." So you could ask them "Would you mind answering a one-question survey before leaving?" and, if they say "yes," take them to the survey page.
You can also cause a popup to happen via the onUnload, but most people nowadays will have those popups blocked.
I've never tried it, but I suppose you could do both: Try the popup and, if it succeeds, just let the page go ahead and close. If the popup does *not* succeed, then you can ask the question about answering the survey.
But I'd bet that you are only going to get a few percent who answer the survey, given these limitations.
|