I need to show an "Exit" popup window in MOSS pages. How can I achieve this?
that's impossible
ArjanP
2010-02-19 01:07:16
A:
- Setup a javascript include for jQuery
- Setup a javascript include file with this code:
var doPopup = true;
$(document).ready(function() {
$('a').click(function() { doPopup = false; });
$('form').submit(function() { doPopup = false; });
});
$(window).unload(function() { onUnloadPopup(); });
function onUnloadPopup() {
if (doPopup) {// do your window.open here }
}
What it does is run the onUnloadPopup everytime the page is exited without clicking either a link or submitting a form. That function can open your exit popup. Be prepared for a lot of issues though. Exit popups are not liked much, browsers will block them and with something as complex as SharePoint you might get some unexpected occurrences..
ArjanP
2010-02-19 01:18:52