Dom's on the Case - Netflix

Posted on Thu 20 June 2019 in netflix

Consumer series hosted by Dom Littlewood.

Type: Documentary

Languages: English

Status: Ended

Runtime: 45 minutes

Premier: 2008-09-22

Dom's on the Case - DOM events - Netflix

DOM (Document Object Model) events allow event-driven programming languages like JavaScript, JScript, ECMAScript, VBScript and Java to 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

This limitation of the JavaScript event model is usually overcome by assigning attributes to the function object of the event handler or by using closures.

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 JavaScript engine of the browser creates an anonymous function 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