public
Created

JSONP Cats Example

  • Download Gist
jsonp.html
HTML
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<script src="http://code.jquery.com/jquery-1.4.4.js"></script> <script>
$.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?",
{
tags: "cat",
tagmode: "any",
format: "json"
},
function(data) {
$.each(data.items, function(i,item){
$("<img/>").attr("src", item.media.m).appendTo("#images");
if ( i == 3 ) return false;
});
});
</script>
<p><style type="text/css">img{ height: 100px; float: left; }</style></p>
<div id="images">&nbsp;</div>
<p><input type="text" /></p>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.