Introducing JSON
page 3 of 9
by Bilal Haidar
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 16130/ 354

What is JSON?

JSON, according to the official website for JSON, is a lightweight data interchange format that is a text-based, human readable format that is used to represent objects, arrays, and other data types that is mainly used to exchange such data types over the network.

JSON is mainly used in web applications AJAX enabled. Such applications force their server-side code, which can be PHP, JSP, ASP.NET, etc … to format the data that they must send back to the requesting client application in a JSON format. Many benefits can be gained out of this process, especially performance gain on the client side since there will be no overhead in generating XML DOM tress out of the XML Data and would be better than simple text in a string-format because JSON would represent the data received in an object-fashion! And all that you have to do on the client is just parse that object-string-formatted into a JSON object and access that object as if you are dealing with a C# or JAVA object!

Since I am talking about objects and arrays, it is worth mentioning that JSON is a subset of the object literal notation of JavaScript and is commonly used with that language. Therefore, since JSON depends on objects and such Object Oriented types, it can be easily used with an Object Oriented Language since they all share the same concept of representing data as objects. Let me show you an example of a JSON object before going on to get a small idea on what I have been talking from the beginning of this article.

Listing 1: JSON simple object

{
      "FirstName""Bilal",
      "LastName""Haidar",
      "Age": 26,
      "Experience":
            ["2004""2005", "2006"]
}

View Entire Article

Article Feedback

Title:  
Name:  
Url: ( Optional )
Comment:  
Please add 2 and 4 and type the answer here:

User Comments

Title: Re: IE7 issue   
Name: Martin
Date: 4/4/2008 2:10:49 AM
Comment:
Ok, but what can I do to make it work in IE7 ? I tryed to set postRequest = null; in the GetEmployeeDetails() method but then it turns back with an error ?
Title: Re:   
Name: Bilal Haidar [MVP]
Date: 4/4/2008 2:04:17 AM
Comment:
This is not a problem in the code! I once asked about that and they said it is an IE issue!! Didn't check later what they have done to solve it!

Thanks
Title: IE7 issue   
Name: Martin
Date: 4/4/2008 1:42:19 AM
Comment:
Hi,

I just downloaded the demo app and tested it in IE7 and when i select an "employee" from the dropdown list it shows up as expected, but when I try to choose another one from the dropdown nothing happens, is there an bug in the code ?
Title: Re:   
Name: Bilal Haidar [MVP]
Date: 5/19/2007 2:41:45 AM
Comment:
Yes it is :)

Regards
Title: Where is Jason?   
Name: AbsCoder
Date: 5/18/2007 6:16:26 PM
Comment:
Thanks for the article; good stuff. In the article you make mention twice of "great JSON DLL that is called Jason.NET". Perhaps, I'm dense, but I can't seem to locate said DLL. Do you mean Newtonsoft's Json.NET library? Again, thanks for your contribution to the community!






Ads Powered by Lake Quincy Media
Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2008 ASPAlliance.com  |  Page Processed at 9/6/2008 11:10:03 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search