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 361 | Next

Raymond Yee

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

photo[i];
t_url = "http://farm" + photo.farm + ".static.flickr.com/" +
photo.server + "/" + photo.id + "_" + photo.secret + "_" + "t.jpg";
p_url = "http://www.flickr.com/photos/" + photo.owner + "/" + photo.id;
s += '' + ''+ photo.title +<br>'' + '';
}
document.writeln(s);
}




5. The previous example is simple but limited by the fact that loading JSON data immediately
calls the function jsonFlickrApi(). You can customize the name of the callback
function with the jsoncallback parameter (for example, jsoncallback=MyHandler). You
can also use the nojsoncallback=1 parameter17 to return raw JSON:
{
"photos" : {
"page" : 1, "pages" : 283353, "perpage" : 3, "total" : "850057",
"photo" : [ {"id" : "397750427", "owner" : "98559475@N00",
"secret" : "f59b1ae9e1", "server" : "180", "farm" : 1,
"title" : "sakura", "ispublic" : 1, "isfriend" : 0, "isfamily" : 0}
, {
"id" : "397750433", "owner" : "81222973@N00",
"secret" : "0023e79dff", "server" : "133", "farm" : 1,
"title" : "just before spring", "ispublic" : 1,
"isfriend" : 0, "isfamily" : 0}
]}
, "stat" : "ok"}
Given this information, you might be wondering why should you use the jsonFlickrApi()
callback in the first place instead of using a pattern based on the examples I showed you in
Chapter 6 of how to use PHP to interact with the Flickr API.


Pages:
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373