Created
November 8, 2010 18:55
-
-
Save jim/668086 to your computer and use it in GitHub Desktop.
Rough example for calling Dribbble API with JavaScript
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" | |
"http://www.w3.org/TR/html4/strict.dtd"> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<title>untitled</title> | |
<meta name="generator" content="TextMate http://macromates.com/"> | |
<meta name="author" content="Jim Benton"> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.js" type="text/javascript" charset="utf-8"></script> | |
<script type="text/javascript"> | |
$(function() { | |
$.getJSON("http://dribbble.com/theskywatcher/shots.json?callback=?", function(data){ | |
$.each(data.shots, function(i,shot){ | |
var title = $('<h1/>').text(shot.title); | |
var image = $('<img/>').attr('src', shot.image_teaser_url); | |
var p = $('<p/>').append(title, image); | |
$('body').append(p); | |
}); | |
}); | |
}); | |
</script> | |
</head> | |
<body> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment