嗨,我需要捕捉的onunload事件,但其在Firefox的工作不是在IE瀏覽器。我們可以在IE中捕獲onUnload事件嗎?如何讓onunload事件在IE
0
A
回答
0
你可以嘗試onbeforeunload事件。
1
可能是一個已安裝的插件禁用任何卸載處理程序(見this blog post)。如果是這種情況,你可以刪除插件或切換到onbeforeunload。
2
有在IE中兩個事件就可以使用。單擊事件名稱以查看MSDN詳細信息。
0
<script type="text/javascript">
function unloadPage(){
return "dont leave me this way";
}
window.onbeforeunload = unloadPage;
</script>
相關問題
- 1. JavaScript + onunload事件
- 2. JavaScript捕獲onload&onunload事件
- 3. 如何讓指針事件在IE中工作?
- 4. 如何在骨幹視圖中使用窗口onunload事件
- 5. 如何在刪除iframe時觸發onunload事件?
- 6. 如何捕獲IE事件
- 7. JS onunload事件不會總是有效
- 8. 用戶出口處的Safari OnUnload事件
- 9. 如何清除javascript中的OnUnload事件中的asp.net會話值
- 10. onunload事件在鉻或有沒有任何替代工作
- 11. 如何在IE中添加事件?
- 12. 如何讓IE 7打開XHTML文件?
- 13. 如何讓IE忽略history.pushState?
- 14. onunload如何正常工作?
- 15. onunload的和onbeforeunlad事件有望在IE11和IIS
- 16. 在javascript中捕獲瀏覽器的onClose事件 - 不是onUnload
- 17. 在Firefox中更改window.location.href以響應onunload事件
- 18. 如何掛入IE的關閉事件
- 19. 如何讓我的AJAX在IE
- 20. 如何讓XMLHttpRequest的不CACH在IE
- 21. 雙擊事件在IE
- 22. 如何從FrameworkElement中爲單元測試目的提升Onload/OnUnload事件?
- 23. IE onpaste JavaScript事件
- 24. IE事件爲空
- 25. IE不onblur事件
- 26. 如何讓backSpace在textchanged事件中像正常一樣行事?
- 27. 如何讓我的文件下載在IE和safari上工作?
- 28. XMLHttpRequest onunload?
- 29. 如何讓Outlook處理事件更新?
- 30. 如何讓mousePressed和mouseDoubleClicked事件互斥?