[译]JavaScript事件(一)目录

本文深入探讨JavaScript中的事件处理,包括事件触发机制、不同浏览器间的兼容性问题、事件处理程序的注册方式等内容,适合希望深入了解JS事件机制的读者。

  学习js的时候,碰见很多莫名其妙的问题,特别是写跨浏览器支持的脚本时。有时候也会为一些看起来很简单的问题难住。前两天有人问为什么弹出确认窗口时要return false。我只知道大家都是这么做的,不知道原因。在查找为什么的时候,看到一个网站http://www.quirksmode.org/里面的js解释的非常详细了,特别是事件处理。搜了一下,还没有中文的版本,就打算把这个网站上的Event部分翻译出来,解释一些简单的js知识,给初学者一些帮助。

本页原文链接:http://www.quirksmode.org/js/contents.html 

事件

用户采取某种行为,事件被触发。大多数脚本由此开始执行。
事件的简单介绍简单介绍事件处理程序。概述正确的问题和正确的回答。
事件跨浏览器的事件的详细介绍
早期的事件处理程序本页解释最古老的添加事件处理程序的方法。甚至连第二代浏览器都支持
传统的事件注册模式本页介绍传统事件处理模式,在左右现代浏览器都支持。还讨论了匿名函数和此模式的小缺点
Advanced modelsThis page discusses the advanced event registration models of W3C and Microsoft. W3C's model is good, Microsoft's isn't.
Event accessingThis page explains how to access an event object. This is necessary if you want to read out event properties.
Event propertiesThis page discusses interesting event properties and the severe browser incompatibilities surrounding their use.
Event orderThis page discusses the two event order models. When the user clicks on a nested element and both this element and its parent element have an onclick event handler, which one fires first?
Mouse eventsDetailed treatment of the mouse events: mouseover, mouseout, mousedown, mouseup, mousemove, click and dblclick.
Event compatibility tablesCompatibility tables for the most common events.
Event pairsTo keep our sites accessible to non-mouse users we must use non-mouse events likefocus or keydown in addition to mouse events. Which non-mouse events can be paired with which mouse events?
Detecting keystrokesHow to detect the keys the user pressed. The details are messy.
addEventSimpleMy utility function for simple unobtrusive event handler creation

  已经翻译的用中文显示,并给出翻译后的文章地址。尚未翻译的显示英文,给出的是原文链接。
第一次翻译错误和不恰当的地方,欢迎大家指出。

转载于:https://www.cnblogs.com/Kamal/articles/javascript_events_contents.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值