0

Any tricky in javascript to listen firefox/IE tab close?

asked 2009-05-09 08:31:31 +0800

sousa1981 gravatar image sousa1981
573 4

Is there any tricky in javascript to listen firefox/IE tab close?

How to do such tricky using zk?

Thanks in advance

delete flag offensive retag edit

7 Replies

Sort by » oldest newest

answered 2009-05-18 07:32:03 +0800

sousa1981 gravatar image sousa1981
573 4

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

link publish delete flag offensive edit

answered 2009-05-18 03:07:57 +0800

plagonell gravatar image plagonell
63

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.

link publish delete flag offensive edit

answered 2009-05-17 20:25:32 +0800

sousa1981 gravatar image sousa1981
573 4

I copy the code and past in zkdemo, and all is running.

link publish delete flag offensive edit

answered 2009-05-17 15:45:15 +0800

plagonell gravatar image plagonell
63

I run this example and it don't work, i need to work with several function in js and the script above is that i want, but don't work i prove with demo zzk 3.6.1. Thanks (i apologize for my english)

link publish delete flag offensive edit

answered 2009-05-16 11:11:38 +0800

sousa1981 gravatar image sousa1981
573 4

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>

link publish delete flag offensive edit

answered 2009-05-11 10:43:49 +0800

sousa1981 gravatar image sousa1981
573 4

Hi hideokidd,

It was just to know if someone has already some needs to implement in ZK, since here maybe found JavaScript hackers :-)

Cheers,

link publish delete flag offensive edit

answered 2009-05-11 05:12:01 +0800

hideokidd gravatar image hideokidd
750 1 2

Hi,

Zk seems not give any hint for the issue,
maybe you have to find the solution by google...

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-05-09 08:31:31 +0800

Seen: 717 times

Last updated: May 18 '09

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More