Pro DOM Scripting with Ajax, APIs and Libraries

  Author:    Stuart Langridge, Aaron Gustafson, Jonathan Snook, Dan Webb
  ISBN:    1590597648
  Sales Rank:    80088
  Published:    2007-07-01
  Publisher:    Apress
  # Pages:    350
  Binding:    Paperback
  Avg. Rating:    5.0 based on 2 reviews
  Used Offers:    12 from $4.97
  Amazon Price:    $33.99
  (Data above last updated:  2008-09-07 07:42:31 EST)
  
  
Sort customer reviews by:
  
Show All Reviews on Page      Hide All Reviews on Page
   
  
Pro DOM Scripting with Ajax, APIs and Libraries
  

If you're a web developer with previous JavaScript and DOM scripting experience, Accelerated DOM Scripting with Ajax, APIs, and Libraries is perfect for you to take your knowledge up to the next level.

This book is about JavaScript and using the document object model—the conduit to the HTML document. This book is not about learning how to program JavaScript from scratch. It starts with the assumption that you have done some JavaScript development before and understand the JavaScript syntax. This book builds on top of that knowledge to give you a deeper understanding of DOM Scripting and how to apply that to your projects. It uses this new understanding to describe what JavaScript libraries are and show you how they can be applied to your project. The book will also explain Ajax and how best to plan and apply it to your projects. It explains how to build simple animation objects for adding movement to elements on the page. There are straightforward examples that demonstrate the techniques used throughout the book.

JavaScript has seen a resurgence in popularity over the past few years, and with it has come an exploration of the power of the language as well as what it can do within the browser. This book will explain techniques new and old—such as closures, encapsulation, and inheritance—that many are using and how you can best apply them to your own projects.

By reading this book, you should have a greater understanding of how JavaScript works and be able to use advanced concepts such as closures and event delegation to build more flexible applications for the Web. You'll walk away with a greater appreciation for JavaScript libraries and how they can simplify and speed up your development. You'll also be able to implement Ajax effectively into your site, create special effects, use JavaScript libraries, and know how best to apply these libraries to your projects.

What you'll learn

  • Where CSS, HTML, and the DOM fit into modern scripting, and how to use them together effectively
  • OOP techniques for more efficient JavaScript coding
  • How to use JavaScript libraries such as Prototype in your work
  • How to build effective form validation into your applications using Ajax
  • How to create mashups using APIs
  • How to build dynamic user interfaces

Who is this book for?

This book is for beginner to intermediate developers, and already have knowledge of HTML, CSS, and JavaScript.

                  Reader Reviews 1 - 2 of 2                 
  
  
Review
Date
Review
Rating(5 High)
Review
Helpful
to:
Customer Review Reviewer
Info
Permanent
Link
Reader Reviews Below Sorted by Newest First
06-28-08 5 1\1
(Hide Review...)  Accelerated Learning
Reviewer Permalink
Accelerated DOM Scripting with Ajax, APIs, and Libraries - despite its lengthy title, is a succinct glimpse into the world of JavaScript programming. Primarily written by developer extraordinaire Jonathan Snook, this book also includes contributions from a veritable who's-who of the JS world: Aaron Gustafson, Stuart Langridge, and Dan Webb. They cover a myriad of topics, including object oriented programming, DOM traversal, and popular libraries:

* Dojo
* Ext
* jQuery
* Mootools
* Prototype
* Scriptaculous
* YUI

The book starts off at a reasonable pace, explaining a brief history of how JavaScript came to be, debunking some of the myths around its viability, and showing some of the differences in implementation between HTML and XHTML. Namely, the use of CDATA for inline scripts. Snook also clarifies the meaning of Ajax, which originally stood for "Asynchronous JavaScript and XML," but has since come to encompass any asynchronous browser - server interaction.

Another topic covered by Snook is that of code maintainability and debugging. While JavaScript comprises one-third of the "holy trinity" (HTML, CSS, JS) of web development, the W3C only offers validation services for the first two. As one transitions from a code savvy designer who can do HTML and CSS, it can be somewhat confusing, left to one's own devices to learn JS.

Luckily, there are plenty of tools available, but one has to look beyond the W3C to find them. Such helpful allies are the Firebug and Web Developer extensions for Firefox, and JSLint - an irreplaceable JS code verifier that offers a variety of strictness and integrity settings. Snook explains how to use these to your advantage, using console.log to catch errors in Firebug, and writing well structured code that passes minification and obfuscation.

Snook explains the importance of taking a wholistic approach to web development, treating HTML and CSS with due respect, ensuring semantics in markup and steering clear of using JS presentational purposes that would be better handled in a stylesheet. He also explains the concepts of nodes as they appear in a page by showing them in a tree structured chart. For instance, a tag is a node, but so is the sum total of the text inside it. As a general rule of thumb, all tags are nodes, but so are their non-tag contents. This is important to remember when attempting to manipulate the DOM via cloneNode.

Another tricky concept, which is handled differently depending on the browser, is event bubbling. Despite the name, this has nothing to do with socializing and everything to do with the way actions are triggered in a browser. Snook explains how this can be used to one's advantage, by assigning an event listener to a containing element, such as a UL, and when it is clicked, checking if the click originated from a particular child element, such as a link within a LI with a certain class. Now you are cooking with fire, because you can build out complex menu systems.

After laying a solid foundation of teaching the fundamentals, the book moves on to the juicier parts - using libraries. Snook cautions against jumping straight into using a library without understanding the nuances of what is happening "under the hood," because if you ever need to debug at a core level, you're stuck.

That being said, in chapter 5 he shows how to do some complex data exchange, mimicking a desktop environment, mentioning how this could be enhanced by Prototype, YUI or jQuery. Chapter 6 is all about doing the really cool stuff - adding visual motion to your pages. Snook shows how to achieve identical tweening effects with Scriptcaculous, jQuery and Mootools.

In chapter 7, Stuart Langridge takes the helm, and explains how to write your own custom form validation. Let me just say from experience that this is typically the best way to go, because the business requirements around what constitutes a valid form entry can often get pretty hairy. For me, it is usually easier to write this by hand, with the help of a library, rather than try to find a one size fits all plugin. Langridge shows how to do this on both the server side, via PHP as well as in the browser using JS. It should be noted that whether or not you're doing client-side validation, server-side is a must-have (JS can be switched off, PHP can't).

In chapter 8, Aaron Gustafson shows how to build an incredibly slick FAQ page, using JS to create an accordion style menu system. He does it in such a way that if JS is unavailable, the it reverts back to a standard page. This notion of adding functionality is called progressive enhancement whereas orchestrating an acceptably elegant fall-back scenario is termed graceful degradation.

For those familiar with Ruby on Rails, chapter 9 is for you. Dan Webb goes step by step, showing how to build a dynamic Ajax drive help system. He uses Prototype for some of the heavy lifting of data processing, and his own custom extensions dubbed Low Pro to assist in making his code unobtrusive. With the core functionality in place, he uses Moo.fx to add in animations.

Aside: The aforementioned Mootools is a full library which had its origins in Moo.fx. Mootools and Prototype both include core DOM functions, and can be considered mutually exclusive. However, if you want the animation style and syntax of Mootools, and area already using the base of Prototype, Moo.fx is a nice add-on. Likewise, Moo.fx and Scriptaculous are mutually exclusive.

Well, that wraps up my review. Hopefully it has encouraged you to dig in further to this well written book. The people involved definitely know their stuff, and the topics covered are highly relevant to the fast pace of web development today.
(Review Data Last Updated: 2008-09-05 07:43:03 EST)
10-23-07 5 5\6
(Hide Review...)  Excellent JavaScript resource to help you dive into libraries and their APIs
Reviewer Permalink
Accelerated DOM Scripting, Ajax, APIs, and Libraries by Jonathan Snook, Aaron Gustafson, Stuart Langridge, and Dan Webb is not just another book on DOM scripting. There are many excellent DOM scripting and JavaScript books available to us as developers. Some are thorough explanations of JavaScript with a little bit about the DOM, while others are full blown books on the subject of DOM scripting. This book takes a slightly different direction discussing DOM scripting in light of Ajax, the array of APIs available, and the many libraries available that help us rapidly develop our applications. Upon hearing of the arrival of this book, I was worried that it might be something that would be considered obsolete the week after it was published due to the rapid rate of change in libraries and APIs. After reading this book, that worry was put to rest as each of the authors did an excellent job of digging into the guts of the libraries, exposing how things are done, how you could do it yourself, and how a library could be of assistance to you.

Contents
Chapter 1 starts us off with an explanation of the state of JavaScript. JavaScript has been abused heavily in the past, and due to this abuse and its inconsistencies - many developers chose to shy away. However, this is no longer the case. Along with explaining the state of JavaScript, we get to look at ways to manage our JavaScript code as well as debug our code. This gives us the tools we need as we begin development throughout the rest of the chapters.

Chapter 2 dives into HTML, CSS, and JavaScript. Often referred to as the trinity of front-end development, it is valuable for you to understand the purpose of each, and how they interact with one another. The basics of each are discussed, and then we move to the DOM and find out how we can use semantic markup and meaningful CSS to create the necessary hooks for our JavaScript to interact. Topics such as traversing, reading, and writing to the DOM, handling attributes, detecting browser support, and handling events are all discussed. This chapter builds from previous chapter, and prepares us as we move on to the following chapters.

Chapter 3 tackles the sometimes tough subject of object oriented programming. Depending on your background and experience in programming, the idea of OOP may seem foreign to you. However, the author does an incredible job of highlighting the benefits, formatting, and examples throughout the entire chapter. Some of the benefits discussed are: Namespaces, closures, and encapsulation. To me, this chapter was one of the most valuable in the entire book as it helps you to understand the programming at the core of the libraries that are discussed. Knowing what is going on under the hood is extremely important as you develop and troubleshoot your code.

Chapter 4 moves us to the discussion of the available libraries. As I stated earlier, I was concerned that this book would quickly become stale due to the change and development of libraries. I couldn't have been more wrong. This chapter doesn't just show you the libraries and move on. This chapter teaches you how the libraries work, how you can develop within the libraries, and explains the benefits of using libraries. It teaches you what takes place under the hood for so many different aspects. Along with teaching these things, the author gives you some tips as you are searching and selecting a JavaScript library to work with, something invaluable as there are many options to choose from.

Chapter 5 moves into the world of Ajax and Data Exchange. This chapter discusses all of the nuances of Ajax. These are the important things that need to be addressed before you start implementing Ajax in your applications. Understanding the data formats that are returned. Understanding the HTTP codes. Understanding the different ActiveX Objects. Understanding how to prepare for and handle failure. All of these things are very important as you use Ajax. After you learn what is going on under the hood and how to put the pieces together, the author shows you how libraries can help you in the process.

Chapter 6 discusses Animation, what most people think of when they hear Ajax. As with the previous chapter, you start off by building a simple animation object, then look to see what the libraries have to offer.

Chapter 7 takes us into form validation with JavaScript. All validation should first take place on the server side, then use the client-side to enhance the user experience. The tricky part comes when you find yourself maintaining two validation codebases, one in a server-side language and one in JavaScript. This chapter brings both of these worlds together and allows you to specify your validation rules in one place, sharing your server-side code with the client-side. This makes the validation process much easier and expandable. If you ever want to add or remove validation rules, you can do it in one spot and both the server-side and client-side will follow suit. As with the previous chapters, we first build our example from scratch so we understand the core, then we see how libraries can help us in the process.

Chapter 8 is a case study in building a FAQ system. This chapter walks through the process of creating a usable, accessible, and progressively enhanced FAQ system. This case study builds the semantic HTML, the necessary CSS hooks, and uses the necessary JavaScript to achieve our tasks. The process is extremely thorough as each and every piece is tackled and dissected in the building process. This case study is an excellent tutorial in using all of the building blocks we have discussed up to this point.

Chapter 9 is another case study that walks us through the process of building a dynamic help system. This current example utilizes the Ruby on Rails framework to build the application. The first part of this case study spends important time in planning and preparation. This is important in any application that uses progressive enhancement. As the author points out, this chapter starts with a solid base of semantic HTML, and then builds the CSS and JavaScript on top where necessary. The planning is in place, the foundation is established, and the hooks are in place. As with the previous case study, this chapter does an excellent job of diving in and showing you all of the little details necessary to put an application together.

Conclusion
This book went beyond my initial expectations. It is geared more towards someone who already has a good understanding of HTML, CSS, and JavaScript. If you are looking for a book to teach you JavaScript, then this is not it. This book will help you take your understanding of JavaScript to the next level, and help you grasp what is going on at the core of your library of choice. This is especially important when you have to troubleshoot a piece of JavaScript, or you have to extend something to fit your needs. This book doesn't simply leave you with an explanation of libraries, but teaches you where libraries are helpful, and how you can fully understand what the libraries have to offer. JavaScript is not evil. JavaScript libraries are not evil. This book will show you how to make proper use of the tools available to you.
(Review Data Last Updated: 2008-06-30 04:20:23 EST)
  
                  Reader Reviews 1 - 2 of 2                 
  
  
  
  
  
  

Because the data used to generate this site come from outside sources, VeryWellSaid.com cannot guarantee the completeness or accuracy of the data.
Search VeryWellSaid™
Google
Web VeryWellSaid™
New subjects are added every week.
View Subjects Below by:
* Top Selling
 (click category name, left)
* Top-Rated Top Sellers
 (click 'Top Rated', right)
In the news...  
Dubai\UAE Top Rated
Influenza\Bird Flu Top Rated
Iraq Top Rated
Supreme Court Top Rated
All Books Top Rated
Arts Top Rated
Photography Top Rated
Digital Photography Top Rated
Digital Cameras Top Rated
Biography Top Rated
Business Top Rated
Management Top Rated
Marketing Top Rated
Sales Top Rated
Stocks Top Rated
Bonds Top Rated
Real Estate Top Rated
Trading Top Rated
Commodities Trading Top Rated
Time Management Top Rated
Starting A Business Top Rated
Children's Top Rated
Comics Top Rated
Computers Top Rated
PC Top Rated
Mac Top Rated
Programming Top Rated
Design Patterns Top Rated
.Net Top Rated
C# Top Rated
Vb.Net Top Rated
Asp.Net Top Rated
Java Top Rated
Python Top Rated
PHP Top Rated
Perl Top Rated
Javascript Top Rated
Ajax Top Rated
CSS Top Rated
Open Source Top Rated
SQL Top Rated
Databases Top Rated
Oracle Top Rated
MySql Top Rated
Sql Server Top Rated
IIS Top Rated
Apache Top Rated
Linux Top Rated
Windows Server Top Rated
Project Management Top Rated
HTML Top Rated
UML Top Rated
IT Certifications Top Rated
Cisco Certifications Top Rated
MCSE Top Rated
MCSD Top Rated
Cooking Top Rated
Italian Cooking Top Rated
Vegetarian Cooking Top Rated
Wine Top Rated
Engineering Top Rated
Entertainment Top Rated
Health Top Rated
Nutrition Top Rated
Dieting Top Rated
Sex Top Rated
History Top Rated
Military History Top Rated
British History Top Rated
Middle East History Top Rated
Land Battles Top Rated
Naval Warfare Top Rated
Air Warfare Top Rated
9/11 Top Rated
Terrorism Top Rated
Home Top Rated
Mortgage\Home Equity Loan Top Rated
Cars Top Rated
Car Buying Top Rated
Sports Cars Top Rated
Cat Top Rated
Humor Top Rated
Horror Top Rated
Law Top Rated
IP Law Top Rated
Legal History Top Rated
Fiction Top Rated
Oprah's Book Club Top Rated
Medicine Top Rated
Cancer Top Rated
Stroke Top Rated
Heart Disease Top Rated
Fertility Top Rated
Diabetes Top Rated
Pharmacology Top Rated
Back Problems Top Rated
Menopause Top Rated
Thyroid Top Rated
Pain Top Rated
Organic Chemistry Top Rated
Immune System Top Rated
Mystery Top Rated
Nonfiction Top Rated
Outdoors Top Rated
Running Top Rated
Radio Control Models Top Rated
Guns Top Rated
Parenting Top Rated
Divorce Top Rated
Professional Top Rated
Reference Top Rated
Religion Top Rated
Romance Top Rated
Science Top Rated
Physics Top Rated
Chemistry Top Rated
Astronomy Top Rated
Psychology Top Rated
Science Fiction Top Rated
Sports Top Rated
Teens Top Rated
Travel Top Rated
USA Top Rated
Europe Top Rated
France Top Rated
Italy Top Rated
England Top Rated
China Top Rated
All Books Arts Biography Click Here For An A-Z Index Of All 213 Best-Seller Subjects Business Children's Comics
Computers Cooking Engineering Entertainment Health History Home Horror Humor Law Fiction Medicine Mystery
Nonfiction Outdoors Parenting Professional Reference Religion Romance Science Sci-Fi Sports Teens Travel
In Association with Amazon.com

Cache miss
(not cached)