點擊瀏覽器右上角的X彈出提示窗口,簡單實作。 複製代碼 代碼如下: <BR> window .onunload = function ()<BR> {<BR> if (event.clientY < 0 returnValue = 'Are you sure you want to leave the page? ';<BR> window.alert('歡迎光臨愛智旮旯的部落格!')<BR> }<BR> }<BR> ><BR><BR> } >