8detect
11/24/2017 - 6:49 PM

$.getJSON P

JSONP

If the URL includes the string "callback=?" (or similar, as defined by the server-side API), the request is treated as JSONP instead. See the discussion of the jsonp data type in $.ajax() for more details.

var flickerAPI = "http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?";
$.getJSON( flickerAPI, {
	tags: "mount rainier",
	tagmode: "any",
	format: "json"
})
.done(function( data ) {
	$.each( data.items, function( i, item ) {
		$( "<img>" ).attr( "src", item.media.m ).appendTo( "#images" );
		if ( i === 3 ) {
			return false;
		}
	});
});