JSFiddle - React, Tailwind, and code Playground
by Harsh Kansagara
HTML
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<button class="getAccess">Login with Facebook</button>
JavaScript
window.fbAsyncInit = function() {
FB.init({
appId : '404947809676875',
xfbml : true,
version : 'v2.5'
});
};
$(function(){
$('.getAccess').click(function(){
myFacebookLogin();
});
});
function myFacebookLogin() {
alert('hi');
FB.login(function(){}, {scope: 'user_posts'});
}
(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/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));