Is there any way to make onbeforeunload work in Opera?

╄→гoц情女王★ 提交于 2019-11-27 08:49:49

问题


I know, that Opera doesnt support JS onbeforeunload message and will not support it. But is there any way to make it work somehow? Or maybe some jQuery plugins can make it work and let script know if window is going to close? I found only way to make onclick for every a tag, but this is not the complete solution.


回答1:


Upgrade to Opera 15. onbeforeunload is now supported in that version because they moved to the WebKit engine. It is still not supported in 12.x because that version and all prior versions are based on Presto.




回答2:


It is not possible to use onbeforeunload with Opera. There is a cross-browser solution, but that solution covers practically every big browser except Opera (IE, FireFox, Safari, Chrome).

This explains unbeforeunload and beforeunload a bit better: http://help.dottoro.com/ljhtbtum.php

Also, this post explains it with a better example: Crossbrowser onbeforeunload?



来源:https://stackoverflow.com/questions/15986731/is-there-any-way-to-make-onbeforeunload-work-in-opera

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!