Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
33 views

"John" "Doe" "Anna" "Smith" "Peter" "Jones"

JSON is a lightweight data-interchange format that is easier to read and write than XML. It is built on two structures: a collection of name/value pairs and an ordered list of values. JSON is primarily used to transmit data between a web server and web application, and it is the primary format used by APIs to exchange information. The JSON format follows JavaScript syntax and allows standardized representation of structured data independent of programming language.

Uploaded by

Rishi Prakash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

"John" "Doe" "Anna" "Smith" "Peter" "Jones"

JSON is a lightweight data-interchange format that is easier to read and write than XML. It is built on two structures: a collection of name/value pairs and an ordered list of values. JSON is primarily used to transmit data between a web server and web application, and it is the primary format used by APIs to exchange information. The JSON format follows JavaScript syntax and allows standardized representation of structured data independent of programming language.

Uploaded by

Rishi Prakash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 3

#JSON: JavaScript Object Notation.

#JSON is a syntax for storing and exchanging data.


#JSON is an easier-to-use alternative to XML.

#JSON is language independent


JSON Structure :

{"employees":[
{"firstName":"John", "lastName":"Doe"},
{"firstName":"Anna", "lastName":"Smith"},
{"firstName":"Peter", "lastName":"Jones"}
]}
Corresponding XML:

<employees>
<employee>
<firstName>John</firstName> <lastName>Doe</lastName>
</employee>
<employee>
<firstName>Anna</firstName> <lastName>Smith</lastName>
</employee>
<employee>
<firstName>Peter</firstName> <lastName>Jones</lastName>
</employee>
</employees>
#The JSON format is syntactically identical to the code for creating JavaScript objects.

#Why JSON is faster than XML


For AJAX applications, JSON is faster and easier than XML:
Using XML
Fetch an XML document
Use the XML DOM to loop through the document
Extract values and store in variables
Using JSON
Fetch a JSON string
JSON.Parse the JSON string

#What is the Syntax of JSON

JSON syntax is derived from JavaScript object notation syntax:

Data is in name/value pairs


Data is separated by commas
Curly braces hold objects
Square brackets hold arrays
#JSON in JavaScript

var employees = [
{"firstName":"John", "lastName":"Doe"},
{"firstName":"Anna", "lastName":"Smith"},
{"firstName":"Peter","lastName": "Jones"}
];
employees[0].firstName + " " + employees[0].lastName;

From JSON Valid String to JSON object. JSON.parse


On Java we have org.json.JSONObject uses .put(name,value),JSONArray uses

.add(JSONObject);
#ArrayList/Arrays of Infos have similar structure as that Of JSON

AngularJS MVC Framework


SPA
2WayBinding using ng-model
Scope, rootScope,Scope,ng-app,ng-view,expressions
Controllers
Services
Filters
Module
Directives
rootProviders

You might also like