O'Reilly logo

PHP Ajax Cookbook by R. Rajesh Jeba Anbiah, Roshan Bhattarai, Milan Sedliak

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Flickr API with Ajax

In this section, we will look at using Flickr API to retrieve images from Flickr.com with the specified search tag that is input from the textbox. In this section, we will see how to use the JSONP web services provided by Flickr using jQuery to get the response directly in JavaScript itself and parse it and display it. We're not using PHP in this example.

Getting ready

JSONP, JSON with padding, is an enhanced format of JSON data in which JSON data is wrapped inside function calls, which allows a page to access the data from a different domain. JSONP allows us cross-domain communication with the help of the<script> element. The XMLHttpRequest object of JavaScript, which is widely used in Ajax applications, is not capable ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required