单击浏览器右上角的X弹出提示窗口,简单实现。
<script language="javascript"> window.onunload = function () { if (event.clientY < 0 && event.clientX> document.body.scrollWidth) { //event.returnValue = 'Are you sure you want to leave the page? '; window.alert('欢迎光临爱智旮旯的博客!') } } </script>