SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 183 | Next

Raymond Yee

"Pro Web 2.0 Mashups: Remixing Data and Web Services"


JSON
The JSON format facilitates the consumption of Flickr feeds in JavaScript. I discuss JSON at
greater length in Chapter 8. However, if you look at the following:
http://api.flickr.com/services/feeds/photos_public.gne?tags=tree&format=json
you can see that Flickr returns JavaScript code, specifically a call to a jsonFlickrFeed() function
with one parameter. This parameter is a JavaScript object that holds the feed data. As a JavaScript
programmer, you can use this JSON-formatted feed by supplying a jsonFlickrFeed() function
to do something with the feed, such as displaying it on a web page.
Here??™s an example of some code that reads the Flickr JSON feed and renders the feed as
HTML in the browser:8
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">



Flickr JSON feed