Archive for the 'Ajax - Javascript' Category

Book Review: AJAX Hacks

A collection of AJAX hacks (recipes) coupled with intelligent discussions. A good book to buy for anyone interested in AJAX and modern web application development.

The book begins with a great introduction to AJAX and then provides a useful grab-bag of commonly needed AJAX applications.

For example:

  • Processing Web forms.
  • Validations: credit card numbers, email addresses etc …

What are AJAX ‘hacks’?

AJAX ‘hacks’ are concise code samples that can be used as ‘components (if you will,) that you can plug into your own work.

Besides the usefulness of having a reusable collection like this, you can learn a lot from the ‘hacks’, since each one is coupled with a good discussion.

Some highlights:

  • Ruby on Rails and AJAX discussions
  • Examination of the open source AJAX libraries like Scriptaculous and Rico.
  • The concise and clear coverage of AJAX basics.

As with all O’reilly books, the writing is clear and concise and well presented.

Note: this is not a beginners tutorial … you will need to be able to work with and understand JavaScript.

Book Review: Head Rush AJAX

Head Rush AJAX targets web designers who have a basic understanding of JavaScript.

A couple of points:

  • A great book for beginners.
  • This book is not well suited for experienced Web programmers because the pace is probably too slow.

Using clever layouts and graphics, along with an easy to understand writing style, Head Rush AJAX makes AJAX very approachable for web designers.

WHAT IS AJAX

AJAX is essentially the combination of technologies (JavaScript, DOM, CSS) built into all modern browsers that allows you to create web apps that act like (from the users perspective,) desktop applications - the so-called ‘rich user experience’. AJAX is used to send data to and from the server, and then display it in a web page, in a seamless way.

AJAX is typically coupled with a server-side technology like:

  • PHP
  • ASP.net
  • Java/J2EE

The server-side languages/environments are used to grab data (say from a database like MySQL) and then hand it off the to AJAX scripts. Wisely, Head Rush AJAX uses PHP as the server-side language to play this role*.

*PHP was the best choice because most web designers are going to jump into PHP over any other language because PHP is easy to learn and is ubiquitous.

HOW THE BOOK TACKLES AJAX

By starting with simple concepts and examples, the book gently takes the reader from humble beginnings to (by the end of the book) where the reader should be comfortable creating AJAX based websites.

Some highlights:

  • Great examination of basic concepts.
  • Good tutorial on DOM scripting - a key component of AJAX
  • Nice comparison between AJAX with XML vs. AJAX with JSON - a lightweight JavaScript data format

Probably the best web designer centric book on AJAX.

Stefan Mischook (Web Design Heretic)

Book review: Professional Ajax

A very good book for experienced web application developers who want to jump into this new way of creating a rich user experience with the web browser.

The writing is clear and straight forward. Each chapter begins with a concise (but informative) theoritical introduction, which is then followed with a practical example that is substantive enough to learn the programming behind the theory, yet not too long that you’ll get bored.

Clearly targetting the enterprise developer, this book covers how AJAX works with:

  • XML, XPath and XSLT
  • Web Services
  • JSON: a Javascript data format that is a lighweight alternative to XML

You can read rest of the topics covered in the book’s TOC.

A HIGHLIGHT OF THE BOOK

I especially liked a section in chapter two (AJAX Basics) that covers the 3 methods used to create AJAX-like experience:

  • The hidden frame technique - what we used to do, to fake it in the late 90’s
  • The hidden iframe technique.
  • Using the XMLHttpRequest object - true AJAX (IMHO)

It was interesting to see working side-by-side comparisons of the methods available to web developers … and it makes you realize how useful the XMLHttpRequest object is!

What’s even more interesting is how the authors have actually combined these three methods in certain applications to create a more flexible AJAX implementation.

CONCLUSION

If you are an experienced web developer who wants to learn AJAX, get this book.

Book Review: Ajax In Action

Introduction:

AJAX In Action targets experienced programmers who may not be familiar with client side Web application development. As such, the book provides a ‘crash-course’ into the basic building blocks of AJAX scripting:

  • CSS for styling markup/HTML
  • CSS for page layout
  • How the DOM (document object model) is used to restructure the page dynamically.

A good book for experienced programmers but not a title for web designers wanting to jump into AJAX. For people with less programming experience (those who know a only little JavaScript,) you are better off with the excellent book for beginners: Head Rush AJAX published by O’reilly.

Then perhaps (with some programming experience behind you,) you can come back to AJAX in Action.

Stefan Mischook
-

WARNING: This review has a 5 star nerd-level … not for beginners.

In a word; a comprehensive book that covers as much ground as could be expected, given the pace of change in the Ajax sphere. Lots of detail here although perhaps a little too much at times – I had to fight to finish it and ended up skimming at times.

About Ajax

Chances are you’ve heard of Ajax – it’s getting a lot of press as the best thing since some other acronym (take your pick). Ajax essentially is a suite of web technologies that allow you to develop web sites that seem more like traditional desktop applications. The web metaphor of click-reload-from-server-click-again is replaced by a user interface that can selectively update itself as the user interacts with it.

There are a number of working Ajax applications in the wild, one prominent example being Google Maps (http://maps.google.com/). The promise of Ajax is of a new generation of distributed applications with better usability and hopefully lots of budgets for those who know how to make them happen.

Rethinking the Web

Part 1 of the book does an overview of Ajax with emphasis on how Ajax applications differ from traditional web sites. In addition the section covers some prominent examples, as well as looking at some alternative technologies such as Flash and Java.

The section then dives into some simple examples of using Ajax technologies like the HttpRequest object and DOM scripting. This provides a nice gentle introduction to the main ideas behind Ajax.

The final section of part 1 looks at some patterns that could/should be used in developing Ajax apps with emphasis on a Model-View-Controller (MVC) framework for client-side Ajax code.

Core Techniques

Having dipped our toe (if not our whole leg) in the water, the authors move on and cover the various patterns that one might expect to use in developing an Ajax application. Quite a lot is covered and there is a lot of code. The authors use some concrete examples that are mostly reasonable, although less experienced web developers may not see the relevance of some of the examples.

Professional Ajax

Part 3 is covers core issues involved in taking an application from the prototype stage to a production application. Issues such as responsiveness and scalability are treated, as are usability issues like providing user feedback (with some example re-usable frameworks provided as examples). In addition security and performance are covered with some good tips on third party tools that can be used to debug hard-to-find problems as you are developing your application.

Ajax by Example

The final part covers the lion’s share of the book and provides some examples of varying complexity. These include code for a double combo box, type ahead suggest (see Google Suggests), a web portal, and others. I did not actually spend a lot of time here as by this point I felt I understood enough of the technologies to use them as I needed. Which is not to say that the code examples are not worth looking at.

Round Up

The book also features some appendices that covers tools like IDEs, third party frameworks and libraries, and a section on JavaScript for object oriented developers. Note that the libraries section necessarily can only be a starting point as there are new contributions coming along fairly often.

All in all a lot of the information in the book can be found on the web, but the book does make it easy to kick back in bed and absorb.

The writing style is very clear although not as entertaining as some technical books I have read lately. I think you’ll find that once you understand the core technologies, stuff starts to get repetitive.

Still the book does a nice job of covering the ground extensively and I recommend it to anyone who wants to learn about writing Ajax applications.

Richard Mischook