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

推荐订阅源

AI
AI
TaoSecurity Blog
TaoSecurity Blog
H
Heimdal Security Blog
Help Net Security
Help Net Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Microsoft Azure Blog
Microsoft Azure Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Google DeepMind News
Google DeepMind News
爱范儿
爱范儿
The Cloudflare Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
人人都是产品经理
人人都是产品经理
大猫的无限游戏
大猫的无限游戏
N
News | PayPal Newsroom
V2EX - 技术
V2EX - 技术
博客园 - 【当耐特】
D
Darknet – Hacking Tools, Hacker News & Cyber Security
S
Secure Thoughts
C
CERT Recently Published Vulnerability Notes
罗磊的独立博客
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Privacy & Cybersecurity Law Blog
有赞技术团队
有赞技术团队
S
Schneier on Security
S
SegmentFault 最新的问题
Google Online Security Blog
Google Online Security Blog
H
Hacker News: Front Page
The Last Watchdog
The Last Watchdog
Schneier on Security
Schneier on Security
PCI Perspectives
PCI Perspectives
IT之家
IT之家
Project Zero
Project Zero
博客园 - 司徒正美
P
Privacy International News Feed
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Jina AI
Jina AI
Security Latest
Security Latest
Hacker News - Newest:
Hacker News - Newest: "LLM"
腾讯CDC
C
CXSECURITY Database RSS Feed - CXSecurity.com
阮一峰的网络日志
阮一峰的网络日志
C
Check Point Blog
aimingoo的专栏
aimingoo的专栏
V
Vulnerabilities – Threatpost
W
WeLiveSecurity
NISL@THU
NISL@THU
Webroot Blog
Webroot Blog
N
Netflix TechBlog - Medium
L
Lohrmann on Cybersecurity

博客园 - silverlightfans

sql server 获取数据库中每个表的磁盘占用情况 扩招的后果(搞笑版) 数据仓库构建实施方法及步骤(转载) treeview非xml数据源绑定 VS 2008 JavaScript Intellisense for Silverlight google 的百毒视频,巨搞笑啊,不知道是不是真的 国际支付平台又添新成员Amazon FPS asp.net 客户端回调功能的实现机制探讨(响应部分及可能的优化) asp.net 客户端回调功能的实现机制探讨(请求部分) 黎巴嫩的一位mvp写的一篇文章 关于为什么web service 构造函数只能是无参数构造函数问题的解答 Silverlight:动态从服务器端获取XAML来绘制前台 网易的高级提示功能 asp.net ajax 包装得似乎有些过分 PageMethods未定义 的解决 微软为google修改Vista 最好不要使用百分比宽高来创建silverlight Silverlight:一个IE浏览器 利用Tiny Framework 从托管代码中直接操作页面的 DOM元素
javascript附加事件,ff 和 ie
silverlightfans · 2007-06-28 · via 博客园 - silverlightfans

  var button1 = document.getElementById("xxx");
    var button2 = document.getElementById("xxxx");
    if(window.addEventListener)
    {
        button1.addEventListener("click",eventtest1,false);
        button2.addEventListener("click",eventtest2,false);
    }
    else if(button1.attachEvent)
    {
        button1.attachEvent("onclick",eventtest1);
        button2.attachEvent("onclick",eventtest2);
    }
 //   button.onclick = check;

在ff下面,用的是addEventListener附加事件,而在IE下面却是用的attachEvent附加事件,所以有点区别,同时,都可以支持button.onclick = check;  这种事件的附加,但是好像这种附加是有缺点的,好像只支持冒泡,不能支持捕获。
addEventListener表示是否捕获事件。
如果想要知道冒泡和捕获的区别,请参看:
http://blog.othree.net/log/2007/02/06/third_argument_of_addeventlistener/
这个已经图文并茂讲得很清楚了。

忘记说了,分离的事件方法应该是:dettachEvent 和 removeEventListener

posted on 2007-06-28 16:37  silverlightfans  阅读(785)  评论()    收藏  举报