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 508187 of Event developer guide

  • Revision slug: Web/Guide/API/DOM/Events
  • Revision title: Event developer guide
  • Revision id: 508187
  • Created:
  • Creator: acuster
  • Is current revision? No
  • Comment

Revision Content

{{draft()}}

Events refers both to a design pattern used for the asynchronous handling of various incidents which occur in the lifetime of a web page and to the naming, characterization, and use of a large number of incidents of different types.

The overview page provides an introduction to the design pattern and a summary of the types of incidents which are defined and reacted to by modern web browsers.

The custom events page describes how the event code design pattern can be used in custom code to define new event types emitted by user objects, register listener functions to handle those events, and trigger the events in user code.

The remaining pages describe how to use events of different kinds defined by web browsers. Unfortunately, these events have been defined piece by piece so that the

Some events originate from the device on which the web browser is running can trigger events, for example due to a change in its position and orientation in the real world, as discussed partially by the page on orientation coordinate systems and the page on the use of 3D transforms. That is different, but similar, to the change in device vertical orientation. 

Some events originate from the window in which the browser is displayed which might, for example, change size if the user maximizes the window or otherwise changes it.

Some events originate from the sequence of events involved in loading a web page and displaying it to the user.

Some events originate due to user interaction with the web page contents. The events triggered by user interaction evolved during the early years of browser design and include a complicated system defining the sequence in which events will be called and the manner in which that sequence can be controlled. The different types of user interaction driven events include:

Some events originate due to the change in the structure and content of the documents, as is explained in the mutation events page, but the use of these events has been deprecated in favour of the lighter Mutation Observer approach.

Some events originate when handling media stereams embedded in HTML documents, as explained in the media events page.

There are many other sources of events defined by web browsers for which pages are not yet available in this guide.

Note: This Event Developer Guide needs substantial work. The structure needs to be reorganized and the pages rewritten. Our hope is that everything you need to know about events will go under here.

Docs

{{LandingPageListSubpages}}

Revision Source

<p>{{draft()}}</p>
<p>Events refers both to a design pattern used for the asynchronous handling of various incidents which occur in the lifetime of a web page and to the naming, characterization, and use of a large number of incidents of different types.</p>
<p>The <a href="/en-US/docs/Web/Guide/API/DOM/Events/Overview_of_Events_and_Handlers">overview page</a> provides an introduction to the design pattern and a summary of the types of incidents which are defined and reacted to by modern web browsers.</p>
<p>The <a href="/en-US/docs/Web/Guide/API/DOM/Events/Creating_and_triggering_events">custom events page</a> describes how the event code design pattern can be used in custom code to define new event types emitted by user objects, register listener functions to handle those events, and trigger the events in user code.</p>
<p>The remaining pages describe how to use events of different kinds defined by web browsers. Unfortunately, these events have been defined piece by piece so that the</p>
<p>Some events originate from the device on which the web browser is running can trigger events, for example due to a change in its position and orientation in the real world, as discussed partially by the <a href="/en-US/docs/Web/Guide/API/DOM/Events/Orientation_and_motion_data_explained">page on orientation coordinate systems</a> and the <a href="/en-US/docs/Web/Guide/API/DOM/Events/Using_device_orientation_with_3D_transforms">page on the use of 3D transforms</a>. That is different, but similar, to the change in device vertical orientation.&nbsp;</p>
<p>Some events originate from the window in which the browser is displayed which might, for example, change size if the user maximizes the window or otherwise changes it.</p>
<p>Some events originate from the sequence of events involved in loading a web page and displaying it to the user.</p>
<p>Some events originate due to user interaction with the web page contents. The events triggered by user interaction evolved during the early years of browser design and include a complicated system defining the sequence in which events will be called and the manner in which that sequence can be controlled. The different types of user interaction driven events include:</p>
<ul>
 <li>the original 'click' event,</li>
 <li>mouse events,</li>
 <li><a href="/en-US/docs/Web/Guide/API/DOM/Events/Mouse_gesture_events">mouse gesture events</a>, and</li>
 <li>both <a href="/en-US/docs/Web/Guide/API/DOM/Events/Touch_events">touch events</a> and the earlier, but deprecated, <a href="/en-US/docs/Web/Guide/API/DOM/Events/Touch_events_(Mozilla_experimental)">mozilla experimental touch events</a>.</li>
</ul>
<p>Some events originate due to the change in the structure and content of the documents, as is explained in the <a href="/en-US/docs/Web/Guide/API/DOM/Events/Mutation_events">mutation events page</a>, but the use of these events has been deprecated in favour of the lighter <a href="/en-US/docs/Web/API/MutationObserver">Mutation Observer</a> approach.</p>
<p>Some events originate when handling media stereams embedded in HTML documents, as explained in the <a href="/en-US/docs/Web/Guide/API/DOM/Events/Media_events">media events</a> page.</p>
<p>There are many other sources of events defined by web browsers for which pages are not yet available in this guide.</p>
<div class="note">
 <p>Note: This Event Developer Guide needs substantial work. The structure needs to be reorganized and the pages rewritten. Our hope is that everything you need to know about events will go under here.</p>
</div>
<h2 id="Docs">Docs</h2>
<p>{{LandingPageListSubpages}}</p>
Revert to this revision