学习框架/对象onbeforeunload事件
1、有没有发现在一些表单提交页面,当我们点击页面某个链接要离开表单提交页面时会弹出一个提示信息,如下:
那么,这是提示是怎么产生的呢?代码如下:
window.onbeforeunload=function(){ return false; }
只要在JavaScript中加入这个代码,就会产生上图的提示了!
附上菜鸟教程详细说明链接:onbeforeunload事件
网站:http://shibowl.top
github:https://github.com/hanbinjxnc
博客园:https://www.cnblogs.com/hool
博客:https://blog.shibowl.top
淘宝店:https://boxunwl.taobao.com/
作者:世博 2019年4月28日
github:https://github.com/hanbinjxnc
博客园:https://www.cnblogs.com/hool
博客:https://blog.shibowl.top
淘宝店:https://boxunwl.taobao.com/
作者:世博 2019年4月28日