event对象的方法 兼容多浏览器
更新时间:2009年06月27日 20:33:25 作者:
event对象的方法 兼容多浏览器 同时兼容ie和ff的写法
复制代码 代码如下:
function getEvent(){ //同时兼容ie和ff的写法
if(document.all) return window.event;
func=getEvent.caller;
while(func!=null){
var arg0=func.arguments[0];
if(arg0){
if((arg0.constructor==Event || arg0.constructor ==MouseEvent)
|| (typeof(arg0)=="object" && arg0.preventDefault && arg0.stopPropagation)){
return arg0;
}
}
func=func.caller;
}
return null;
}
相关文章
JavaScript使用prototype定义对象类型(转)[
JavaScript使用prototype定义对象类型(转)[...2006-12-12详解Python中logging日志模块在多进程环境下的使用
许多应用程序中都会有日志模块,用于记录系统在运行过程中的一些关键信息,以便于对系统的运行状况进行跟踪。这篇文章给大家主要介绍了在Python中logging日志模块在多进程环境下的使用,需要的朋友可以参考借鉴,下面来一起看看吧。2016-12-12浅析为什么a="abc" 不等于 a=new String("abc")
这篇文章主要介绍了为什么a="abc" 不等于 a=new String("abc"),需要的朋友可以参考下2017-10-10
最新评论