惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Forbes - Security
Forbes - Security
GbyAI
GbyAI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
S
SegmentFault 最新的问题
Y
Y Combinator Blog
Recorded Future
Recorded Future
博客园 - Franky
I
InfoQ
T
The Blog of Author Tim Ferriss
Recent Announcements
Recent Announcements
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园_首页
阮一峰的网络日志
阮一峰的网络日志
T
Tailwind CSS Blog
Cyberwarzone
Cyberwarzone
The Register - Security
The Register - Security
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
雷峰网
雷峰网
P
Palo Alto Networks Blog
G
GRAHAM CLULEY
Cloudbric
Cloudbric
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
MongoDB | Blog
MongoDB | Blog
F
Full Disclosure
Google DeepMind News
Google DeepMind News
Recent Commits to openclaw:main
Recent Commits to openclaw:main
C
Check Point Blog
爱范儿
爱范儿
The GitHub Blog
The GitHub Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
W
WeLiveSecurity
T
Threat Research - Cisco Blogs
U
Unit 42
N
Netflix TechBlog - Medium
The Cloudflare Blog
Spread Privacy
Spread Privacy
Microsoft Azure Blog
Microsoft Azure Blog
美团技术团队
T
Troy Hunt's Blog
Engineering at Meta
Engineering at Meta
H
Heimdal Security Blog
TaoSecurity Blog
TaoSecurity Blog
C
Cybersecurity and Infrastructure Security Agency CISA
T
Tenable Blog
B
Blog
S
Securelist
H
Hacker News: Front Page
Google Online Security Blog
Google Online Security Blog
G
Google Developers Blog

博客园 - 周末

JS判断IE6,ie7,ie8,ff ASP.NET(C#) 四舍五入、进一法、舍位(取整,舍去小数,向负无穷舍入)函数 在线用户统计的实现方法 HttpModule与HttpHandler详解 IE bug: 1像素的dotted/dashed边框 JS日期计算函数 关于JS冒泡的问题 jQuery load()方法的美妙用法 兼容各主流浏览器的简单拖拽drag CSS 使用expression方法优化 判断 iframe 是否加载完成的完美方法 setCapture,captureEvents,releaseCapture 的技巧。 经典左右两列布局CSS 准确取得当前滚动条的位置 不常用的有意思的标签:optgroup log4net的日志输出格式-log4net.Layout.PatternLayout用法 log4net 将日志按不同类型写入多个文件 FireFox使用技巧 vs2008.net多语言实现方法
同时兼容ie和ff的获取事件的方法
周末 · 2009-10-10 · via 博客园 - 周末

Posted on 2009-10-10 15:31  周末  阅读(379)  评论(0)    收藏  举报

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;
}

刷新页面返回顶部