Consumer series hosted by Dom Littlewood.
Runtime: 45 minutes
Dom's on the Case - DOM events - Netflix
DOM (Document Object Model) events allow event-driven programming
register various event handlers or listeners on the element nodes inside
a DOM tree, such as in HTML, XHTML, XUL and SVG documents. Historically,
like DOM, the event models used by various web browsers had some
significant differences. This caused compatibility problems. To combat
this, the event model was standardized by the World Wide Web Consortium
(W3C) in DOM Level 2.
Dom's on the Case - Inline model - Netflix
assigning attributes to the function object of the event handler or by
In the inline model, event handlers are added as attributes of elements.
In the example below, an alert dialog box with the message “Hey Joe”
appears after the hyperlink is clicked. The default click action is
cancelled by returning false in the event handler.
One common misconception with the inline model is the belief that it
allows the registration of event handlers with custom arguments, e.g.
name in the triggerAlert function. While it may seem like that is the
case in the example above, what is really happening is that the
containing the statements in the onclick attribute. The onclick handler
of the element would be bound to the following anonymous function:
Dom's on the Case - References - Netflix