HTML and CSS Reference
In-Depth Information
PLAYER 1: JSON
JSON
(or JavaScript Object Notation) is a lightweight, easy and popular way to exchange
5
data. jQuery is not the only tool for manipulating and interfacing with JSON; it's just my and
many others' preferred method.
A lot of the services we use everyday have JSON-based APIs: Twitter, Facebook and Flickr all
send back data in JSON format.
A JSON response from an API looks like this:
([{
"score"
:
null
,
"popularity"
:
3
,
"translated"
:
true
,
"adult"
:
false
,
"language"
:
"en"
,
"original_name"
:
"The Goonies"
,
"name"
:
"The
Goonies"
,
"alternative_name"
:
"I Goonies"
,
"movie_type"
:
"movie"
,
"id"
:
9340
,
"imdb_id"
:
"tt0089218"
,
"url"
:
"http
:
//www.themoviedb.org/movie/9340",
"votes"
:
16
,
"rating"
:
9.2
,
"certification"
:
"PG"
,
"overview"
:
"A young teenager
named Mikey Walsh finds an old treasure map in his father's attic
.
Hoping to save their homes from demolition
,
Mikey and his friends Data Wang
,
Chunk Cohen
,
and Mouth Devereaux runs off on a big quest to find the secret
stash of the pirate One
-
Eyed Willie
.
","
released
":"
1985
-
06
-
07
"
,
"posters"
:[{
"image"
:{
"type"
:
"poster"
,
"size"
:
"original"
,
"height"
:
1500
,
"width"
:
1000
,
"url"
:
"http
:
//cf1.imgobject.com/posters/76b/4d406d767b9aa15bb500276b/
the-goonies-original.jpg",
"id"
:
"4d406d767b9aa15bb500276b"
}}],
"backdrops"
:[{
"image"
:{
"type"
:
"backdrop"
,
"size"
:
"original"
,
"height"
:
1080
,
"width"
:
1920
,
"url"
:
"http
:
//cf1.imgobject.com/backdrops/242/4d690e167b9aa13631001242/
the-goonies-original.jpg",
"id"
:
"4d690e167b9aa13631001242"
}}],
"version"
:
3174
,
"last_modified_at"
:
"2011-09-12
13:19:05"
}])
A bit of a mess, right? Compare this to the same JSON viewed in Google Chrome's developer
console: