Created
November 19, 2010 17:07
-
-
Save johnjosephhorton/706797 to your computer and use it in GitHub Desktop.
JSONP Cats Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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"> </div> | |
<p><input type="text" /></p> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment