触发事件浏览器返回按钮点击 [英] trigger event on browser back button click

查看:235
本文介绍了触发事件浏览器返回按钮点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何监听浏览器返回按钮单击并调用我已定义的功能,并禁用后退按钮的正常行为?我正在使用jQuery。

How do I listen for a browser back button click and call a function that I've defined and disable the normal behaviour of the back button? I'm using jQuery.

推荐答案

jQuery历史插件 可帮助您在JavaScript应用程序中支持后退/转发按钮和书签。您可以将应用程序状态存储到URL哈希中并从中恢复状态。

jQuery history plugin helps you to support back/forward buttons and bookmarks in your javascript applications. You can store the application state into URL hash and restore the state from it.

这篇关于触发事件浏览器返回按钮点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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