HTML, XHTML and CSS All-In-One for Dummies - Andy Harris [279]
For these reasons, Web programmers began to compile commonly used functions into reusable libraries. These libraries became more powerful over time, and some of them have now become fundamental to Web development.
As these libraries became more powerful, they not only added AJAX capabilities, but many of them also added features to JavaScript/DOM programming that were once available only in traditional programming languages. Many of these libraries allow a new visual aesthetic as well as enhanced technical capabilities. In fact, most applications considered part of the Web 2.0 revolution are based in part on one of these libraries.
A number of very powerful JavaScript/AJAX libraries are available. All make basic JavaScript easier, and each has its own learning curve. No library writes code for you, but a good library can handle some of the drudgery and let you work instead on the creative aspects of your program. JavaScript libraries can let you work at a higher level than plain JavaScript, writing more elaborate pages in less time.
What is Web 2.0?
I’m almost reluctant to mention the term Web 2.0 here, because it isn’t really a very useful description. People describe Web 2.0 — if such a thing really exists — in three main ways:
Some talk about Web 2.0 as a design paradigm (lots of white space, simple color schemes, rounded corners). I believe the visual trends will evolve to something else and that other aspects of the Web 2.0 sensibility will have a longer-lasting impact.
The technical aspects of Web 2.0 (heavy use of AJAX and libraries to make Web programming more like traditional programming) are more important than the visual aspects. These technologies make it possible to build Web applications in much the same way that desktop applications are now created.
I personally think the most important emerging model of the Web is the change in the communication paradigm. Web 2.0 is no longer about a top-down broadcast model of communication, but more of a conversation among users of a site or system. While the visual and technical aspects are important, the changing relationship between producers and users of information is perhaps more profound.
The design and communication aspects are fascinating, but this book focuses on the technical aspects. When you work in Web 2.0 technologies, decide for yourself how you will express the technology visually and socially. I can’t wait to see what you produce.
Several important JavaScript/AJAX libraries are available. Here are a few of the most prominent:
♦ DOJO: A very powerful library that includes a series of user interface widgets (like those in Visual Basic and Java) as well as AJAX features.
♦ MochiKit: A nice lower-level set of JavaScript functions to improve JavaScript programming. It makes JavaScript act much more like the Python language, with an interactive interpreter.
♦ Prototype: One of the first AJAX libraries to become popular. It includes great support for AJAX and extensions for user interface objects (through the scriptaculous extension).
♦ Yahoo User Interface (YUI): This is used by Yahoo! for all its AJAX applications. Yahoo! has released this impressive library as open source.
♦ jQuery: This has emerged as one of the more popular JavaScript and AJAX libraries. It is the library emphasized in this book.
Introducing jQuery
This book focuses on the jQuery library. While many outstanding AJAX/JavaScript libraries are available, jQuery has quickly become one of the most prominent. The following are some reasons for the popularity of jQuery:
♦ It’s a powerful library. The jQuery system is incredibly powerful. It can do all kinds of impressive things to make your JavaScript easier to write.