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.

Revision 98720 of EventListener

  • Revision slug: DOM/EventListener
  • Revision title: EventListener
  • Revision id: 98720
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment moved from nsIDOMEventListener page; page created, 90 words added

Revision Content

Method overview

void handleEvent(in nsIDOMEvent event);

Methods

handleEvent()

This method is called whenever an event occurs of the type for which the EventListener interface was registered.

void handleEvent(
  in nsIDOMEvent event
);
Parameters
event
The event to register.

Remarks

As the interface is marked with the [function] flag, all JavaScript Function objects automatically implement this interface. Calling the {{ manch("handleEvent") }} method on such an implementation automatically invokes the function.

See also

  • {{ spec("https://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-EventListener","Document Object Model Events: EventListener","REC") }}

Revision Source

<h2 name="Method_overview">Method overview</h2>
<table class="standard-table"> <tbody> <tr> <td><code>void <a href="#handleEvent()">handleEvent</a>(in nsIDOMEvent event);</code></td> </tr> </tbody>
</table>
<h2 name="Methods">Methods</h2>
<h3 name="handleEvent()">handleEvent()</h3>
<p>This method is called whenever an event occurs of the type for which the <code>EventListener</code> interface was registered.</p>
<pre class="eval">void handleEvent(
  in nsIDOMEvent event
);
</pre>
<h6 name="Parameters">Parameters</h6>
<dl> <dt><code>event</code></dt> <dd>The event to register.</dd>
</dl>
<h3 name="Remarks">Remarks</h3>
<p>As the interface is marked with the <span class="nowiki">[function]</span> flag, all JavaScript <a href="/en/JavaScript/Reference/Global_Objects/Function" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a> objects automatically implement this interface. Calling the {{ manch("handleEvent") }} method on such an implementation automatically invokes the function.</p>
<h2 name="See_also">See also</h2>
<ul> <li>{{ spec("https://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-EventListener","Document Object Model Events: EventListener","REC") }}</li>
</ul>
Revert to this revision