Created
October 23, 2012 14:48
-
-
Save nathancahill/3939203 to your computer and use it in GitHub Desktop.
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
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> | |
<script> | |
$(document).ready(function(){ | |
$.getJSON('http://stage.prope.rs/api/<account_name>', function(props) { | |
$(props).each(function(id) { | |
root = $('<div />').addClass('prop').append( | |
'<span class="text" />', | |
'<span class="name" />', | |
'<span class="date" />', | |
'<img />', | |
'<span class="description" />', | |
'<span class="source" />' | |
); | |
for (var i in props[id]) { | |
if (!props[id].hasOwnProperty(i)) continue; | |
$('.' + i, root).html(props[id][i]); | |
} | |
$('img', root).attr('src', props[id].img); | |
$('#propers').append($('<a />').attr('href', props[id].link).append(root)); | |
}); | |
}); | |
}); | |
</script> | |
<link href="reset.css" rel="stylesheet" /> | |
<style> | |
#propers a { | |
text-decoration: none; | |
color: inherit; | |
} | |
.prop { | |
float: left; | |
width: 300px; | |
padding: 10px; | |
margin: 5px; | |
border: 1px solid gray; | |
} | |
.prop .name { | |
display: block; | |
margin-top: 10px; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="propers"></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment