使用Javascript:如何改写页面重载的事件吗? [英] Javascript: how to overwrite page reload event?

查看:537
本文介绍了使用Javascript:如何改写页面重载的事件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的意思是 - 当某些浏览器页面重载/刷新按钮,我们不想重新加载页面用户点击 - 我们希望捕获的事件,并调用一些功能(简单的例子,一个用一些警报)。我需要它在IE6和和铬,当然FF3 +工作。如何做这样的事情(不使用jQuery和其他库)?

What I mean is - when user clicks on some browser page reload/refresh button we do not want to reload page - we want to capture that event and call some function (for simple example one with some alert). I need it to work in IE6 and up and chrome and FF3+ of course. How to do such thing (not using jQuery and other libs)?

推荐答案

您不能。您无法从IE以外的任何浏览器中更改操作系统的功能。

You cannot. You can't change the operating system functionality from within any browser except IE.

这篇关于使用Javascript:如何改写页面重载的事件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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