Fb logout Button
Facebook Javascript SDK: Basic Login and Logout example · GitHub
Instantly share code, notes, and snippets.
Last active 3 months ago
Facebook Javascript SDK: Basic Login and Logout example
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId: 'xxxxxxxxxxxxx',
status: true,
cookie: true,
xfbml: true
// Load the SDK asynchronously
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));
function login() {
FB.login(function(response) {
// handle the response
console.log("Response goes here!");
}, {scope: 'read_stream,publish_stream,publish_actions,read_friendlists'});
}function logout() {
FB.logout(function(response) {
// user is now logged out
});var status = FB.getLoginStatus();
</script>
<button onclick="javascript:login();">Login Facebook</button>
<br>
<button onclick="javascript:logout();">Logout from Facebook</button>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Facebook Javascript SDK: Basic Login and Logout example · GitHub
Instantly share code, notes, and snippets.
Last active 3 months ago
Facebook Javascript SDK: Basic Login and Logout example
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId: 'xxxxxxxxxxxxx',
status: true,
cookie: true,
xfbml: true
// Load the SDK asynchronously
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));
function login() {
FB.login(function(response) {
// handle the response
console.log("Response goes here!");
}, {scope: 'read_stream,publish_stream,publish_actions,read_friendlists'});
}function logout() {
FB.logout(function(response) {
// user is now logged out
});var status = FB.getLoginStatus();
RELATED POSTS:
- How to unblock ads on Facebook
- Download foto instagram online
- How to find a Facebook Stalker
- Aquarius horoscope Today
- Facebook login through mobile Number
- Instagram deleted my Likes
- Fb sign in and log In Password
- Delete location on Facebook
- Log in Facebook Facebook
- How to unblock ppl on Fb
- Facebook messenger recovery Tool
</script>
<button onclick="javascript:login();">Login Facebook</button>
<br>
<button onclick="javascript:logout();">Logout from Facebook</button>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
0 comments:
Post a Comment
Facebook has greatly reduced the distribution of our stories in our readers' newsfeeds and is instead promoting mainstream media sources. When you share to your friends, however, you greatly help distribute our content. Please take a moment and consider sharing this article with your friends and family. Thank you.