Skip to content

Instantly share code, notes, and snippets.

@ashaw
Created August 31, 2012 19:03
Show Gist options
  • Save ashaw/3557473 to your computer and use it in GitHub Desktop.
Save ashaw/3557473 to your computer and use it in GitHub Desktop.
<html>
<head>
<style>
#box {
width:200px;
height:200px;
background:black;
}
#box.red {
background:red;
}
</style>
<script src="jq.js"></script>
<script>
$(function(){
$(document).ready(function() {
var username = "ashaw"
var url = "http://graph.facebook.com/" + username;
$.getJSON(url + "?callback=?", function(resp) {
$("h1").html(resp.first_name);
$("a").attr("href", resp.link);
$("img").attr("src", "https://graph.facebook.com/" + username + "/picture" );
});
});
});
</script>
</head>
<body>
<h1></h1>
<img src="">
<a href="#">Click here to see my profile</a>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment