A Pen by Kevin Dench on CodePen.
Created
October 8, 2015 18:19
-
-
Save mrcleanandfresh/0fde42f8c8362510e85b to your computer and use it in GitHub Desktop.
qOjdNj
This file contains 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
<div id="response"> | |
</div> | |
This file contains 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
$.ajax({ | |
url: "http://www.behance.net/v2/users/kdench/projects?api_key=BcO2sz2y46Ucak6mICBdOwhX0UCF6ylM", | |
// The name of the callback parameter, as specified by the YQL service | |
jsonp: "callback", | |
// Tell jQuery we're expecting JSONP | |
dataType: "jsonp", | |
// Tell YQL what we want and that we want JSON | |
data: { | |
format: "json" | |
}, | |
// Work with the response | |
success: function(response) { | |
var html = ""; | |
$(response.projects).each(function(index) { | |
html += "<div id='"+this.id+"' class='wrapper'>"; | |
html += "<img src='"+this.covers[404]+"' />"; | |
html += "<p>Project: "+this.name+"</p>"; | |
html += "<p>Views: "+this.stats.views+"</p>"; | |
html += "<p>Appreciations: "+this.stats.appreciations+"</p>"; | |
html += "</div>"; | |
}); | |
$("#response").append(html); | |
} | |
}); |
This file contains 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="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> |
This file contains 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
body { | |
background-color: white; | |
} | |
.wrapper { | |
margin: 15px; | |
background-color: lighten(grey, 40%); | |
border-radius: 5px; | |
padding: 20px; | |
display: inline-block; | |
width: 400px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment