JSON (JavaScript Object Notation) is a light weight data interchange format alternative to using xml with Ajax. It is a subset of the JavaScript object literal notation that which is basically made of 2 object types. The first being a collection of name value pairs similar to a hash table. An ordered list of values is the other, basically representing an array. The following shows how to write a JSON object in JavaScript and access it.
var company = {
name: "Software Inc.",
employees: [
{
name: "Mike",
skill: "Java"
},
{
name: "Joe",
skill: "HTML"
},
{
name: "Betty",
skill: "C++"
}
]
};
// Access the data
var employee2 = company.employees[1];