11.12.2012 Views

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Table 11-14: Additional Properties of the Event Object for Key-Related Events in<br />

Mozilla<br />

Property Description<br />

Unicode value of the key depressed<br />

>metaKey Boolean indicating if the META key was depressed during event<br />

>shiftKey Boolean indicating if the SHIFT key was depressed during event<br />

Browser Events<br />

DOM2 browsers support the familiar browser and form-related events found in all major<br />

browsers. <strong>The</strong> list of these events is found in Table 11-15.<br />

Table 11-15: Browser- and Form-Related DOM2 Events and <strong>The</strong>ir Behaviors<br />

Event Bubbles? Cancelable?<br />

load No No<br />

unload No No<br />

abort Yes No<br />

error Yes No<br />

select Yes No<br />

change Yes No<br />

submit Yes Yes<br />

reset Yes No<br />

focus No No<br />

Blur No No<br />

resize Yes No<br />

scroll Yes No<br />

UI Events<br />

Although DOM Level 2 builds primarily on those events found in the (X)HTML specification (and<br />

DOM Level 0), it adds a few new User Interface (UI) events to round out the field. <strong>The</strong>se events<br />

are prefixed with ―DOM‖ to distinguish them from ―normal‖ events. <strong>The</strong>se events are listed in<br />

Table 11-16.<br />

Table 11-16: UI-Related DOM2 Events and <strong>The</strong>ir Behaviors<br />

Event Bubbles? Cancelable?<br />

DOMFocusIn Yes No<br />

DOMFocusOut Yes No<br />

DOMActivate Yes Yes<br />

<strong>The</strong> need for and meaning of these events is not necessarily obvious. DOMFocusIn and<br />

DOMFocusOut are very similar to the traditional focus and blur events, but can be applied to<br />

any element, not just form fields. <strong>The</strong> DOMActivate event is fired when an object is receiving<br />

activity from the user. For example, it fires on a link when it is clicked and on a select menu

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!