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 744181 of EventListener

  • Revision slug: Web/API/EventListener
  • Revision title: EventListener
  • Revision id: 744181
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment Mountain View APIRef Project

Revision Content

{{APIRef("DOM Events")}}

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 DOM {{ domxref("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

<p name="Method_overview">{{APIRef("DOM Events")}}</p>

<h2 id="Method_overview" 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 id="Methods" name="Methods">Methods</h2>

<h3 id="handleEvent()" 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 id="Parameters" name="Parameters">Parameters</h6>

<dl>
 <dt><code>event</code></dt>
 <dd>The DOM&nbsp;{{ domxref("Event") }} to register.</dd>
</dl>

<h3 id="Remarks" 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 id="See_also" 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