Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FB.login({scope: 'email'},function(response){
- if(response.status == 'connected'){
- alert('I am connected')
- }
- });
- FB.login(function(response){
- if(response.status == 'connected'){
- alert('I am connected')
- }
- },{scope: 'email'});
- <!DOCTYPE html>
- <html>
- <body>
- <div id="fb-root"></div>
- <a href="#" onclick="getEmail();return false;">Get Email</a>
- <script src="http://connect.facebook.net/en_US/all.js"></script>
- <script>
- FB.init({ appId: '**AppID**', status: true, cookie: true, xfbml : true });
- function getEmail() {
- FB.login(function(response) {
- if (response.session && response.perms) {
- FB.api('/me', function(response) {
- alert('Email: ' + response.email);
- }
- );
- }
- } , {perms:'email'});
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement