开发者

How to add an Exit popup window in MOSS 2007

开发者 https://www.devze.com 2022-12-10 06:26 出处:网络
I need t开发者_Python百科o show an \"Exit\" popup window in MOSS pages. How can I achieve this? Setup a javascript include for jQuery

I need t开发者_Python百科o show an "Exit" popup window in MOSS pages. How can I achieve this?


  • 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..

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号