Skip to content

@singalen /my.js secret

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Facebook connect code
window.fbAsyncInit = function () {
// Attach event handlers for Facebook operations:
$('[data-facebook="login"]').click($.proxy(Foobar.Social.Facebook.toggleConnection, Foobar.Social.Facebook));
$('[data-facebook="logout"]').click($.proxy(Foobar.Social.Facebook.toggleConnection, Foobar.Social.Facebook));
// Trigger FB loaded state:
$.event.trigger(Foobar.Events.FB_LOADED);
FB.init({
appId : window.fbAppId, // App ID
// channelUrl : 'http://localhost:8080/channel.html', // Channel File
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
// Subscribe to Facebook events:
FB.Event.subscribe('auth.statusChange', Foobar.Social.Facebook.onStatusChange);
};
// Load the SDK asynchronously:
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
<div id="social">
<div class="fb-like" data-href="{{ url('fd') }}" data-send="false"
data-layout="button_count" data-show-faces="false"></div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.