mozilla

Revision 22786 of CustomEvent

  • Revision slug: DOM/Event/CustomEvent
  • Revision title: CustomEvent
  • Revision id: 22786
  • Created:
  • Creator: Sephr
  • Is current revision? No
  • Comment removed redundant "Arg" endings; 11 words added, 11 words removed

Revision Content

{{ gecko_minversion_header("6.0") }}

The DOM CustomEvent are events initialized by an application for any purpose. It's represented by the {{ interface("nsIDOMCustomEvent") }} interface, which extends the {{ interface("nsIDOMEvent") }} interface.

Method overview

void initCustomEvent(in DOMString type, in boolean canBubble, in boolean cancelable, in any detail);

Attributes

Attribute Type Description
detail any The data passed when initializing the event.

Methods

initCustomEvent()

Initializes the event in a manner analogous to the similarly-named method in the DOM Events interfaces.

void initCustomEvent(
  in DOMString type,
  in boolean canBubble,
  in boolean cancelable,
  in any detail
);
Parameters
type
The name of the event.
canBubble
A boolean indicating whether the event bubbles up through the DOM or not.
cancelable
A boolean indicating whether the event is cancelable.
detail
The data passed when initializing the event.

Specification

  • {{ spec("http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#interface-CustomEvent","DOM Level 3 Events : CustomEvent","WD") }}

Revision Source

<p>{{ gecko_minversion_header("6.0") }}</p>
<p>The DOM <code>CustomEvent</code> are events initialized by an application for any purpose. It's represented by the {{ interface("nsIDOMCustomEvent") }} interface, which extends the {{ interface("nsIDOMEvent") }} interface.</p>
<h2 name="Method_overview">Method overview</h2>
<table class="standard-table"> <tbody> <tr> <td><code>void <a href="#initCustomEvent()">initCustomEvent</a>(in DOMString type, in boolean canBubble, in boolean cancelable, in any detail);</code></td> </tr> </tbody>
</table>
<h2 name="Attributes">Attributes</h2>
<table class="standard-table"> <tbody> <tr> <td class="header">Attribute</td> <td class="header">Type</td> <td class="header">Description</td> </tr> <tr> <td><code>detail</code></td> <td><code>any</code></td> <td>The data passed when initializing the event.</td> </tr> </tbody>
</table>
<h2 name="Methods">Methods</h2>
<h3 name="initCustomEvent()">initCustomEvent()</h3>
<p>Initializes the event in a manner analogous to the similarly-named method in the DOM Events interfaces.</p>
<pre class="eval">void initCustomEvent(
  in DOMString type,
  in boolean canBubble,
  in boolean cancelable,
  in any detail
);
</pre>
<h6 name="Parameters">Parameters</h6>
<dl> <dt><code>type</code></dt> <dd>The name of the event.</dd> <dt><code>canBubble</code></dt> <dd>A boolean indicating whether the event bubbles up through the DOM or not.</dd> <dt><code>cancelable</code></dt> <dd>A boolean indicating whether the event is cancelable.</dd> <dt><code>detail</code></dt> <dd>The data passed when initializing the event.</dd>
</dl>
<h2>Specification</h2>
<ul> <li>{{ spec("http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#interface-CustomEvent","DOM Level 3 Events : CustomEvent","WD") }}</li>
</ul>
Revert to this revision