You are on page 1of 21

Presented by

Pushkar S. Dahibhate

JSON is a simple, common representation of


data.
Communication between servers and browser
clients.
Language independent data interchange.

Database Model

Document Model

Programming Language Model

JavaScript Object Notation

Minimal

Textual

Subset of JavaScript

A Subset of ECMA-262 Third Edition.

Language Independent.

Text-based.

Light-weight.

Easy to parse.

JSON is not a document format.


JSON is not a markup language.
No cyclical/recurring structures.
No invisible structures.
No functions.

Filename extension :- .json


Internet media type :- application/json
Uniform Type Identifier (UTI) :public.json
Type of format :- Data interchange
Extended from :- JavaScript

Douglas Crockford was the first to specify


and popularize the JSON format
The JSON.org Web site was launched in 2002.
In December 2005, Yahoo! began offering
some of its Web services in JSON
Google started offering JSON feeds for its
GData web protocol in December 2006.

Strings
Numbers
Booleans
Objects
Arrays
Null

Sequence of 0 or more Unicode characters

No separate character type


A character is represented as a string with a length
of 1

Wrapped in "double quotes"


Backslash escapement

Integer
Real
Scientific
No octal or hex

True
False

var Pushkar = {
"age" : "22",
"hometown" : Aurangabad, MH",
"gender" : "male"
};
This creates an object that we access using the
variable Pushkar

document.write(Pushkar is ' Pushkar.age);


// Output: Pushkar is 22
document.write('Jason is a ' Pushkar.gender);
// Output: Pushkar is a male

Chinese
English
French
German
Italian
Japanese
Korean
Spanish

JSON

XML

Stands For

JSON : JavaScript Object Notation.

XML: Extensible Markup Language.

Extended From

JSON is extended from JavaScript.

Purpose

JSON is one type of text-based format or


standard for interchanging data i.e. human
readable.

Syntax

JSON syntax is lighter than XML as JSON


has serialized format of data having less
redundancy. JSON does not contain start and
end tags.
JSON is light weighted in compare to
XML and so faster also.
JSON supports datatype including integer
and strings
JSON does not support Comments

XML is extended from SGML :


Standard Generalized Markup
Language.
XML is a Markup Language having
format that contains set of rules for the
encoding the documents which is readable
for both human & machine.
XML is not so lighter as JSON as having
start and end tags and it takes more
character than JSON to represent same
data.
XML is not so light weighted as JSON. So
it slower
XML does not provide any data type so
needs to be parsed into particular data
type
XML supports comments

For Web services, JSON is better.

For configuration, XML is better

You can not change JSON data to other


format

In XML, using XSLT you can change


XML data into another format like
comma delimited, plain text, JSON, etc

Speed

Support of Data Type


Comments
Application
Changing Format

JSON is light weight component. It doesnt


take more time for execution.
It supports data structures used in modern
languages.
In Java script we cannot retrieve values from
other files for example java.
In JSON we can retrieve values from
anywhere. It supports all languages

You can not change JSON data to other


format.

JSON Doesn't Have Namespaces.

JSON Has No Validator.

JSON Is Not Extensible.

"Doug Crockford "Google Tech Talks:


JavaScript: The Good Parts"
"JSON: The Fat-Free Alternative to XML".
json.org

You might also like