-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Is there any tricky in javascript to listen firefox/IE tab close?
How to do such tricky using zk?
Thanks in advance
With cortesy of Atticat blog http://www.javaworld.com.tw/roller/atticcat/
<zk> <!-- JAVASCRIPT --> <script type="text/javascript" > zk.listen(window, "beforeunload", showMsg); function showMsg() { if (confirm("Está a tentar fechar a aplicação ou então efectuou um refresh.\nDeseja sair da aplicação?")) { alert("YES"); // Call an server function } } </script> <window width="150px" height="80px" border="normal" title="Testing Javascript" closable="true"> <button label="Test Javascript" action="onclick: showMsg()"/> </window> </zk>
Hi, i copy the code and run only in firefox 3.0.10. In IE 7.0.5730.11IC and Google Chrome 1.0.154.65 don't work, in IE give an error "fallo al procesar AddAFt Object required" and two option "redraw or close". In Google Chrome don't work, nor error, but don't run. I have a lot of problems with IE and javascript with ZK, well thanks.
Yes, you are right, I only tested it with Firefox on Ubuntu.
I will need install IE on Ubuntu.
I think you can google and found an way to close tab in IE7, I think I already see it
If you found any thing, please post it here.
I will post to you too.
BTW, ZK actual is wrapping an onbeforeunload and onunload check it please http://www.zkoss.org/forum/index.zul#path%3DlistComment%3BdiscussionId%3D8250%3BcategoryId%3D14%3B
Asked: 2009-05-09 08:31:31 +0800
Seen: 717 times
Last updated: May 18 '09