【发布时间】:2013-02-15 15:39:41
【问题描述】:
这里我遇到了以下代码的问题,我编写了以下代码来检测browser's close event 以使用户logged out 来自网站。
但不幸的是,此事件也会在 Refresh 上触发 :(.
Window.addWindowClosingHandler(new Window.ClosingHandler() {
public void onWindowClosing(Window.ClosingEvent closingEvent) {
closingEvent.setMessage("Do you really want to close the page?");
}
});
是的,我通过了 GWT detect browser refresh in CloseHandler
但我没有发现任何积极的结果。
根据 GWT Window.ClosingEvent class api:
Fired just before the browser window closes or navigates to a different site.
但我仍然希望我们能检测到browser refresh。
任何人都可以对此提供提示吗?
【问题讨论】:
标签: events gwt user-interface browser