The document discusses JSON (JavaScript Object Notation), which is a lightweight format for exchanging data between a client and server. It notes that JSON is easy for humans to read and write, and easy for machines to parse and generate. The document outlines the syntax of JSON, including that objects use curly braces, members use key-value pairs separated by commas, and arrays use square brackets. It also discusses parsing and accessing JSON data.
3. What is JSON?Stands for JavaScript Object NotationIs lightweight format for exchanging data between the client and server.Easy for humans to read and write.Easy for machines to parse and generate Often used in Ajax applications due toIts simplicityits format which is based on JavaScript object literals
4. Why JSON?JSON is recognized natively by JavaScriptSimple formatThe easiness of reading The easiness of using Lighter than XML
7. JSON SyntaxFor objects start the object with { and end it with } For members (properties), use pairs of string : value and separate them by commas For arrays put the arrays between [] For elements put the values directly separated by commas
8. Example var myFirstJSON ={ "firstName" : "John", "lastName" : "Doe", "age" : 23 };
9. JSON ParserYou can convert JSON object into JSON textObject to Text Conversion var myJSONText = myObject.toJSONString();
10. Accessing Data in JSONThe most common way to access JSON data is through dot notation. var myObject = { 'color' : 'blue' };document.writeln(myObject.color);