Skip to content

Instantly share code, notes, and snippets.

@pure
Created January 4, 2012 12:36
Show Gist options
  • Save pure/1559863 to your computer and use it in GitHub Desktop.
Save pure/1559863 to your computer and use it in GitHub Desktop.
<!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></title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://github.com/pure/pure/raw/master/libs/pure.js"></script>
</head>
<body>
<div class="template">
<li>
<img />
</li>
</div>
<script type="text/javascript" charset="utf-8">
var data = $.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?&tags=r2d2&tagmode=all&format=json&jsoncallback=?",
function(json){
var directive = {
'li':{
'it<-items':{
'+.':'it.title',
'img@src':'it.media.m'
}
}
};
$('div.template').render(json, directive);
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment