Java Reference
In-Depth Information
The frameworks covered in this chapter are established, stable, popular, and compatible with every
major modern browser (and even legacy versions of IE). You'll learn about:
Modernizr: A library designed to detect HTML5 and CSS features supported by the browser.
( http://modernizr.com/ )
Prototype: A framework that provides a simple API to perform web tasks. Although it
offers ways of manipulating the DOM, Prototype's primary aim is to enhance the JavaScript
language by providing class definition and inheritance. ( http://www.prototypejs.org )
MooTools: A framework that aims to be compact while offering a simple API to make
common tasks easier. Like Prototype, MooTools also aims to enhance the JavaScript
language—not just make DOM manipulation and Ajax easier. It also includes a lightweight
effects component originally called moo.fx. ( http://www.mootools.net )
These are just a tiny sampling of what is available for you to use in your web pages. Some other
solutions not covered in this chapter are:
Yahoo! User Interface Framework (YUI): A framework that ranges from basic JavaScript
utilities to complete DHTML widgets. Yahoo! has a team devoted to developing YUI.
( http://developer.yahoo.com/yui/ )
Ext JS: This framework started as an extension to the YUI. It offers customizable UI widgets
for building rich Internet applications. ( http://www.extjs.com )
Dojo: A toolkit designed around a package system. The core functionality resembles that of
any other framework (DOM manipulation, event normalization, DHTML widgets, and so
on), but it provides and allows a way to add more functionality by adding more packages.
( http://www.dojotoolkit.org )
MochiKit: A framework that prides itself on its well‐testedness (hundreds of tests according
to the MochiKit site) and its compatibility with other JavaScript frameworks and libraries.
( http://www.mochikit.com )
digging into modernizr
As you undoubtedly know from various previous chapters, JavaScript development is not utopia. It
never has been, and realistically, it never will be simply due to the fact that multiple browsers exist
(which is a good thing—don't get us wrong), and there is a certain disparity between the features
those browsers implement. This is especially true as new features are developed and introduced to the
browser. For example, HTML5 and CSS3 introduce many new features that some browsers haven't
yet implemented. If you want to use any of these new features in your page or application, you have to
ensure that the browser your visitor is using properly supports them. Otherwise, your page will break.
In Chapter 8, you learned how to write code that targets specific features through a process called
feature detection, and although feature detection is a time‐tested strategy, two problems exist:
Some features can be difficult to detect.
Different browsers may support what is essentially the same feature, but it may be
implemented differently.
 
Search WWH ::




Custom Search