GWT后退按钮浏览器 [英] GWT back button browser

查看:135
本文介绍了GWT后退按钮浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,当前页面是www.google.com。
但是我在地址栏中输入了一个不同的网站地址,然后点击。这个网站有完整的
GWT代码。



但我喜欢回到www.google.com的上一页。
所以我点击了浏览器的后退按钮,但是我怎么才能从当前的
GWT代码中获取后退按钮的事件。我可以在当前页面的GWT中设置任何后台事件处理程序吗?
向我通知后退按钮已被按下的人。



有没有GWT的解决方案?

解决方案

Window.ClosingEvent


在浏览器窗口
关闭或导航到不同的
网站之前触发。


另一个选项是 History.addValueChangeHandler ,它监听浏览器历史堆栈中的更改(请参阅文档更多信息)。


For example current page is www.google.com. But I typed a different website address in address bar and clicked. This site has fully GWT code.

But I like to back to the previous page of www.google.com. So I clicked back button of browser.but how can I get event of back button from current GWT code. Can I set any backbutton event handler in GWT of current page? One which notifies an alert to me that back button was pressed.

Is there any solution from GWT?

解决方案

There's Window.ClosingEvent:

Fired just before the browser window closes or navigates to a different site.

The other option is History.addValueChangeHandler, which listens for changes in the browser's history stack (see the docs for more info).

这篇关于GWT后退按钮浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆