Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.