| By Kurt Cagle | Article Rating: |
|
| March 22, 2007 03:00 PM EDT | Reads: |
4,129 |
This content is reprinted from Real-World AJAX: Secrets of the Masters published by SYS-CON Books. To order the entire book now along with companion DVDs for the special pre-order price, click here for more information. Aimed at everyone from enterprise developers to self-taught scripters, Real-World AJAX: Secrets of the Masters is the perfect book for anyone who wants to start developing AJAX applications.
A Brief Note on JSON
The object notation used by JavaScript has made its way into a way to transmit structure better in a number of different languages. JSON (JavaScript Object Notation) has gained a fair amount of interest as a somewhat lighter-weight alternative to XML, especially when used across pipes for AJAX transmission.
In essence, the idea is that you can serialize any object's state as a hash of other objects, each of which can also be broken down as a hash of either other objects or primitives. For instance, you could create a JSON object of a person's record, including his address:
var rec = {identity:{ firstName:"Aleria", surName:"Delamare", gender:"female"},
address:{ street: "1234 Fairmont Drive", city:"Arkham", state:"MA"}, display:
function(){alert(this.identity.firstName +" " + this.identity.surName);} }
The advantage of JSON is that when transmitted, such objects can be reconstructed easily (especially if going from a JavaScript environment to a JavaScript environment) without specialized parsers. The disadvantage of JSON is that it doesn't necessarily transmit state as effectively as XML does in heterogeneous environments. However, a significant number of AJAX applications now routinely make use of JSON as their primary serialization method, especially for client-to-client communications.
Summary
I've tried the near impossible in this (loooong) chapter - covering the highlights of JavaScript in a single chapter of a book. It was, at best, only a partially successful endeavor, as there are obviously many, many elements that could have been covered in greater detail (date manipulation, for instance) that weren't for lack of space. However, if all that had been covered, this would have been a book on JavaScript basics, not the power and beauty of AJAX.
This chapter has focused on the client application, but AJAX also has a fairly formal server-side requirement. In Chapter 3, the server-side components of AJAX will be explored in greater detail, showcasing how AJAX is not only a rich client application but actually a design methodology for changing the role of both client and server.
This content is reprinted from Real-World AJAX: Secrets of the Masters published by SYS-CON Books. To order the entire book now along with companion DVDs, click here to order.
Published March 22, 2007 Reads 4,129
Copyright © 2007 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Kurt Cagle
Kurt Cagle is a developer and author, with nearly 20 books to his name and several dozen articles. He writes about Web technologies, open source, Java, and .NET programming issues. He has also worked with Microsoft and others to develop white papers on these technologies. He is the owner of Cagle Communications and a co-author of Real-World AJAX: Secrets of the Masters (SYS-CON books, 2006).
- Kindle 2 vs Nook
- Cloud Computing on Gartner's Top 10 List and SYS-CON Events' 2010 Calendar
- Confessions of a Ulitzer Addict
- IBM Hardware Chief, Intel VC Exec Arrested in Insider Trading Scam
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Moving Your RIA Apps into the Cloud: Seven Challenges
- Adobe’s Aiming ColdFusion at Multiple Clouds
- Windows 7 – Microsoft’s First Step to the Cloud
- Ulitzer Provides a Powerful Social Journalism Platform
- Jill Tummler Singer, Deputy CIO of CIA, Keynotes at GovIT Expo
- Open Source Mobile Cloud Sync and Push Email
- Kindle 2 vs Nook
- The Difference Between Web Hosting and Cloud Computing
- Cloud Computing on Gartner's Top 10 List and SYS-CON Events' 2010 Calendar
- Ajax in RichFaces 3.3, JSF 2 and RichFaces 4
- Confessions of a Ulitzer Addict
- IBM Hardware Chief, Intel VC Exec Arrested in Insider Trading Scam
- My Thoughts on Ulitzer
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- US Post Office Hops a Ride on NetSuite’s Cloud
- Moving Your RIA Apps into the Cloud: Seven Challenges
- Adobe’s Aiming ColdFusion at Multiple Clouds
- Building a Drag-and-Drop Shopping Cart with AJAX
- What Is AJAX?
- Google Maps! AJAX-Style Web Development Using ASP.NET
- Flashback to January 2006: Exclusive SYS-CON.TV Interviews on "OpenAjax Alliance" Announcement
- AJAXWorld Conference & Expo to Take Place October 2-4, 2006, at the Santa Clara Convention Center, California
- AJAX Sponsor Webcasts Are Now Available at AJAXWorld Website
- How and Why AJAX, Not Java, Became the Favored Technology for Rich Internet Applications
- "Real-World AJAX" One-Day Seminar Arrives in Silicon Valley
- AJAXWorld University Announces AJAX Developer Bootcamp
- AJAX Support In JadeLiquid WebRenderer v3.1
- Where Are RIA Technologies Headed in 2008?
- Struts Validations Framework Using AJAX




































