首页
Java
登录
6mi
u
盘
搜
搜 索
Java
如何阻止浏览器的默认行为?
如何阻止浏览器的默认行为?
xiaoxiao
2021-02-28
99
function
stopDefault
(e)
{
//如果提供了事件对象,则这是一个非 ie 浏览器
if
(e && e.preventDefault){
//阻止浏览器的默认动作
e.preventDefault(); }
else
{
//ie 中阻止函数默认动作的方式
window.event.returnValue =
false
; }
return
false
; }
转载请注明原文地址: https://www.6miu.com/read-69209.html
技术
最新回复
(
0
)