Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Event()

翻譯不完整。請協助 翻譯此英文文件

Event() constructor 能用來建立一個 事件

語法

event = new Event(typeArg, eventInit);

參數

typeArg
為一 DOMString ,用來表示事件名稱。
eventInit選擇性
一個 EventInit object,包含以下欄位
參數 可選 默認值 類型 說明
"bubbles" false Boolean 表示該事件是否懸浮(bubble up)。
"cancelable" false Boolean 表示該事件是否已取消(canale)。

範例

// 建立一個 bubbles up 、並未被取消的事件 “look” 。
var ev = new Event("look", {"bubbles":true, "cancelable":false});
document.dispatchEvent(ev);

規格

Specification Status Comment
DOM
The definition of 'Event()' in that specification.
Living Standard Initial definition.

瀏覽器相容性

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
BasicSupport 15 11 (11) No support 11.60 Nightly build (535.2)
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support ? 11.0 (11) ? ? ?

參見

文件標籤與貢獻者

 此頁面的貢獻者: jackblackevo, Shiyou
 最近更新: jackblackevo,