From 65cc6eabd71b1bceccf6fd3d3d4970c2955f3784 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Thu, 10 Dec 2020 08:37:18 -0500 Subject: dump 2020-12-10 --- .../web/api/eventtarget/attachevent/index.html | 94 +--------------------- 1 file changed, 3 insertions(+), 91 deletions(-) (limited to 'files/zh-cn/web/api/eventtarget') diff --git a/files/zh-cn/web/api/eventtarget/attachevent/index.html b/files/zh-cn/web/api/eventtarget/attachevent/index.html index 3ddf224034..41ce03185b 100644 --- a/files/zh-cn/web/api/eventtarget/attachevent/index.html +++ b/files/zh-cn/web/api/eventtarget/attachevent/index.html @@ -1,96 +1,8 @@ --- title: 为这个EventTarget附加事件. slug: Web/API/EventTarget/attachEvent +tags: + - Junk translation_of: Web/API/EventTarget/addEventListener --- -

{{APIRef("DOM Events")}}

- -

{{ Non-standard_header() }}

- -

摘要

- -

这是早期IE浏览器(IE8及早期版本)的一个专有的替代性标准,替代EventTarget.addEventListener()方法,{{domxref("EventTarget.addEventListener()")}} 方法

- -

语法

- -
attached = target.attachEvent(eventNameWithOn, callback)
-
-
- -
-
 作用的元素(target)
-
一个用于监听事件的文档对象模型元素
-
事件名伴随On(eventNameWithOn)
-
监听的事件名以on前置,类似一个属性的管理者,譬如当你使用onclick时能够监听你的click事件
-
回调函数
-
当目标触发事件时回调函数被调用。这个函数被调用时不带参数,并且这些都将设置在window object.这个对象中
-
附加
-
    是否成功附加上属性会以布尔值表示
-
- -

规范

- -

不存在于任何标准规范中

- -

微软在MSDN有详细描述 has a description on MSDN.

- -

浏览器是否合适

- -

{{ CompatibilityTable() }}

- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support{{ CompatNo() }}{{ CompatNo() }}6 thru 10 [1]{{ CompatUnknown() }}{{ CompatNo() }}
-
- -
- - - - - - - - - - - - - - - - - - - -
FeatureAndroidFirefox Mobile (Gecko)IE PhoneOpera MobileSafari Mobile
Basic support{{ CompatNo() }}{{ CompatNo() }}{{ CompatUnknown() }}{{ CompatUnknown() }}{{ CompatNo() }}
-
- -

[1]: attachEvent() 不再被IE11支持。

- -

{{domxref("EventTarget.addEventListener()")}}被IE9+支持.

- -

See also

- - +

{{DOMxRef("EventTarget.addEventListener","EventTarget.addEventListener()")}}

-- cgit v1.2.3-54-g00ecf