Skip to content

Instantly share code, notes, and snippets.

@VinnyFonseca
Created June 10, 2013 13:06
Show Gist options
  • Save VinnyFonseca/5748562 to your computer and use it in GitHub Desktop.
Save VinnyFonseca/5748562 to your computer and use it in GitHub Desktop.
Facebook Implementation
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({
appId : "XXXXXXXXX",
status : false,
cookie : true,
xfbml : true
});
FB.Event.subscribe("edge.create", function (href, widget) {
alert("like " + href);
});
FB.Event.subscribe("edge.remove", function (href, widget) {
alert("dislike " + href);
});
FB.Event.subscribe("message.send", function (href, widget) {
alert("You sent " + href);
});
};
(function(d) {
var js, id = "facebook-jssdk"; if (d.getElementById(id)) {return;}
js = d.createElement("script"); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
d.getElementsByTagName("head")[0].appendChild(js);
} (document));
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment