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.

encountered. <strong>The</strong> browser generally enters quirks mode when an older or unknown HTML<br />

DOCTYPE is encountered, and also if the DOCTYPE is missing. Visually, developers may<br />

notice slight layout changes between modes given the difference between layout models.<br />

Furthermore, <strong>JavaScript</strong> developers may notice that some proprietary features are absent in<br />

standards mode and that some tags or attributes may no longer be recognized causing extreme<br />

headaches. Always remember, correct <strong>JavaScript</strong> rests upon well-formed markup (not to be<br />

repetitious but you really need to know your (X)HTML to be a good <strong>JavaScript</strong> programmer).<br />

Other improvements introduced in IE6 include the ability to capture mouse wheel events,<br />

support for P3P, improvements to the XML-handling capabilities (see Chapter 20), and various<br />

usability and multimedia (HTML+TIME) enhancements. A useful security feature for application<br />

developers is the ability to specify the security="restricted" attribute and value for<br />

s and s. Using this attribute causes the document loaded in the frame to<br />

execute in the restricted browser security context (see Chapter 22), effectively disabling<br />

scripting and other kinds of potentially dangerous behavior.<br />

Now that we‘ve outlined the major proprietary features available in various versions of Internet<br />

Explorer, let‘s examine some of them in a bit more detail.<br />

CSS Filters<br />

CSS Filters provide a way for developers to add a rich set of visual special effects to their<br />

pages without having to resort to embedded multimedia files (such as Flash). <strong>The</strong>se capabilities<br />

are available as proprietary CSS (and <strong>JavaScript</strong>) extensions in systems capable of displaying<br />

256 or more colors that are running IE4+. Filters change the static appearance of content in a<br />

way that is very similar to the filters provided by graphics manipulation programs such as<br />

Photoshop. Transitions provide movie-like special effects during page loads, for example, fadeins<br />

and pixelations.<br />

Filters and transitions can be applied to elements through scripts or through the use of static<br />

CSS. Specific properties for each filter and transition give the developer a wide range of<br />

flexibility over the nature of each effect. For example, they allow the specification of different<br />

colors, transition speeds, and even ambient lighting.<br />

While full details of CSS Filters are beyond the scope of this book, the following example<br />

illustrates the use of the Xray filter. You can try it yourself by substituting your own image for<br />

―myimage.gif.‖ Clicking the image toggles the Xray filter.<br />

<br />

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

Saved successfully!

Ooh no, something went wrong!