Flylib.com

Books Software

 
 
 

Ajax Hacks: Tips & Tools for Creating Responsive Web Sites - page 9


Preface

Ajax , a term coined in 2005 to describe the combination of a group of popular web technologies, has been an instant hit in the software world. Instant success can raise many doubts , but it would be a mistake to view this software model as simply the latest " next big thing" to make a big splash and then vanish into the ether of the Web.

Why? First of all, Ajax's interweaved technologies, including JavaScript, the Document Object Model (DOM), and Cascading Style Sheets (CSS), live in the world of the Web, where new information and technologies hit millions of people in milliseconds . If the technique represents an interesting idea with practical merit, a good probability exists that developers will at least dip their toes into the technology's waters, if not immediately add the new tool to their code arsenals. Second, the Ajax family of techniques are already well known and open source, or free of charge; therefore, few barriers exist to trying them out for at least a prototype version of new software. Third, a number of useful, well-known applications are based on Ajax, such as Flickr and Gmail. Fourth, web users are already accustomed to an Ajax application's desktop-like experience, where the application can make client/server connections without completely changing the browser page.

There are numerous other reasons why Ajax is here to stay, such as the excellent support for JavaScript, CSS, and DOM provided by modern browsers such as Firefox, as well as the pros and cons of using Macromedia Flash for Rich Internet Applications instead.



Building Single-Page Applications

The "single-page application" represented by Ajax, with client/server connections that do not interrupt the user 's experience and dynamically change elements in different web page regions , is appropriate for numerous uses, such as blogs , learning tools, online newsletters, and small web portals or communities. Many of these types of sites are already built using Ajax techniques. Ajax can also improve the user experience in large web-based client/server applications that extend beyond the single-page model.

The time between the conception of this book and the writing of this preface has seen Ajax morph into a software platform that dominates headlines on the Web, not to mention the birth of new acronyms such as Ajaj (Asynchronous JavaScript and JSON) and lingo such as "Ajaxy" (as in an Ajaxy server connection). Software innovations and human language seem to share the same organic dynamic.



Explaining Ajax

Ajax Hacks was written by yours truly and seven different contributors, many of whom are among the innovators, bloggers, and early adopters who helped give Ajax and its open source tools the boost it enjoys today. They are senior web engineers and developers whose homes stretch from Bangalore to San Francisco, a scope reflecting the diverse and serendipitous nature by which the writers found this book and the book discovered its writers. (See the Credits for more details on these writers.)

Ajax Hacks collects not only dozens of easy-to-grasp, cutting-edge explorations of Ajax technology, such as Google/Yahoo! mapping mash-ups, drag-and-drop bookstores, and single-page web services apps, but a large number of hacks that represent practical advice for Ajax developers. Ajax Hacks also introduces JavaScript newbies and aficionados alike to useful code libraries, including Prototype, Rico, and script.aculo.us . Chapter 7 focuses on a practical and new web application framework with excellent Ajax tools including Ruby on Rails.

A number of the contributions are hacks in the original, clever sense of the term , exploring topics such as using algorithms and Flash objects to simulate a browser history list and store Ajax- related data offline, configuring Apache to fix the XMLHttpRequest cross-domain restrictions, running a search engine inside your browser, and mashing up Yahoo! Maps with a location-to-URL service called GeoURL.

Some of the contributed hacks illustrate cool web controls and embedded scripts, such as a hack that scripts an auto-complete field from scratch, a hack that creates JavaScript bookmarklets that do not have size limitations, and another that creates an RSS feed reader for an Ajax application. These are hacks that push the envelope, just as we approach the cusp of this web model's formulation. At the same time, web developers can adapt a number of this book's hacks, some of which are distributed as open source libraries, for their own applications.