YYZtech.ca

Learning jQuery 1.3

Learning to use jQuery to build better websites, though examples and popular plug-ins.

By: Staff

AdSense

Learning jQuery 1.3 aims to teach the reader a bit of everything that this popular JavaScript library offers and provide a guide to some of the more useful plug-ins available for it. It starts by taking the reader though some basic examples of how to add jQuery to a web-page before a series of chapters explaining different parts of the library and then a series of projects. The contents of the book could be summed up as: What is jQuery, what can you do with it?, and how do you do it.

Readers already familiar with jQuery might be wondering how quickly this book was put together, considering the version in the title was only released this past January. However jQuery has been in testing for several months and since author Karl Swedberg is a member of the jQuery Project Team so it's a safe bet he had some idea what was coming in 1.3, like the the new .live() binding options covered in one of the break-out boxes that dot the book.

What is jQuery?
Older web developers remember what JavaScript development was like before 2005 when most developers where using JavaScript for things like form-validation and any kind of visual effects where best left to Flash. When Prototype (from where jQuery borrowed the $()-syntax) and script.aculo.us arrived with Ruby of Rails it was the start of a re-birth for JavaScript. Prototype put the ability to manipulate the web page in reach of the average developer.

John Resig was inspired by Prototype to create his own library in 2006 that took the idea of manipulating the page further; with jQuery HTML was just the raw structure waiting to be "queried" and molded with JavaScript. It became easy to attach JavaScript functions to page elements so that adding validation to a form could be as easy as the web designer adding a specific CSS class to an HTML tag. Instead of the old way of mixing HTML and JavaScript into each other, the HTML could remain clean and readable to human or DreamWeaver alike and the additional functionality sat waiting in a "$(document).ready(" at the end of the page.

What can you do with it?
JQuery excels at finding elements in the page and then acting on them. I remember seeing an example, written with and without jQuery, that found all the external links in a HTML page and added an icon before them- with jQuery half a page of JavaScript shrunk down to 3-4 lines. Learning jQuery devotes the first set of chapters to showing how properly using jQuery's handling of selectors, events, animation and Ajax can achieve some powerful things in a fraction of the space pure JavaScript would take. If there is anything missing, I didn't see much coverage of optimizing your code. For instance, jQuery's selection engine can do some powerful searches, but it is still written in JavaScript so it might have been good to have some tips here. By the end of the first set of chapters, readers should have a good idea though of how to use jQuery's core functions.

How do you do it?
After these chapters comes a set on how to manipulate tables, forms and adding dynamic elements to a page (shufflers and rotators). These are quite in-depth and show the authors have a range of knowledge of how to use jQuery effectively. The last two chapters cover plug-ins-- both how to write them and some of the more useful ones out there, including a brief introduction to the jQuery UI library.

The appendix includes a good set of tutorials, including one on JavaScript closures. Some readers might not be aware that the familiar "$(document).ready(function() {...})" syntax is actually a closure should be aware of some of the issues involving this JavaScript language feature.

Conclusion:
Like may Packt books, layouts are clean, functional with a few graphics, break-out boxes to illustrate important points (like the new .live() /.die() enhancements to .bind() methods). The book follows the format of: show the reader how to get started, what can be done with the base library and then show what else is out there. After the contents, preface book has a guide to what is covered in the chapters, wish more books had this. The book's chapters cover the basics (getting started, selectors, events, effects), the more complicated ( DOM manipulation, AJAX, Table manipulation) and finally forms, shufflers and rotators, and the plug-ins: using plug-ins (including recommended ones), writing your own. Finally there are some on-line resources, development tools, a bit on JavaScript closures and a quick-reference.

Date published: 30-Apr-2009

AdSense

Comments

AdSense

Related

Eloquent JavaScript

By treating JavaScript as a language in its own right, the author has produced a solid guide to learning a language you might think you already knew.

Prototype and script.aculo.us

Using the Prototype and script.aculo.us Javascript libraries to simply your life.

Algorithms in a Nutshell

Before picking an algorithm know what problem you're trying to solve.

Coders at Work

Talking to programmers.

PHP and MySQL Web Development

Programming with PHP and MySQL with security in mind.

Sponsored



2017 YYZTech



For American computers stores, visit: AmericanComputerDealer.com

Google+