views:

116

answers:

2

I need to show an "Exit" popup window in MOSS pages. How can I achieve this?

A: 

any updates ?? I also need to do this not by using javascript..

abhay
that's impossible
ArjanP
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