Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6712365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:15:03+00:00 2026-05-26T08:15:03+00:00

I am using JavaScript API to create my app for Facebook. The problem is,

  • 0

I am using JavaScript API to create my app for Facebook. The problem is, it’s returning
email = undefined.

I don’t know why? And if I use Facebook login/logout button on my app then the alert shows correct email id of the user but I don’t want to do that.
What am I missing?

Here is my code:

<p><fb:login-button autologoutlink="true" perms="user_about_me,email"></fb:login-button></p>

<script>
window.fbAsyncInit = function () {
  FB.init({ appId: '250180631699888', status: true, cookie: true,
  xfbml: true
});

  FB.getLoginStatus(function (response) {
    if (response.session) {
      greet();
    }
  });
};
(function () {
  var e = document.createElement('script');
  e.type = 'text/javascript';
  e.src = document.location.protocol +
  '//connect.facebook.net/en_US/all.js';
  e.async = true;
  document.getElementById('fb-root').appendChild(e);
} ());

function greet() {
  FB.api('/me', function (response) {
  alert('Welcome, ' + response.name + "!");
  alert('Your email id is : '+ response.email);
});
}
</script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:15:04+00:00Added an answer on May 26, 2026 at 8:15 am

    According to the latest info on the facebook page you should use ‘scope’ instead of perms.
    https://developers.facebook.com/docs/reference/javascript/FB.login/

    If you visit

    https://developers.facebook.com/tools/console/

    and use the fb-api -> user-info example as a starting point, then logout and back in again, it should ask you for email perms and you can see your email being printed. It is done using response.email as you mention in your post.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use Google Chart API using javascript. (I don't want to use
I'm using the After Effects CS3 Javascript API to dynamically create and change text
I'm trying to create map (using the Google Maps JavaScript API V3 ) which
I'm using Facebook Graph API on Google App Engine. I was able to fetch
I am using the Ribbit javascript api and trying to figure out how not
I have a scenario where I am using Google Map JavaScript API to process
I am using the Photoshop's javascript API to find the fonts in a given
I want to implement my own clustering algorithm using this Virtual Earth javascript API:
HTML5 draft contains an API called EventSource to stream data (notifications) trough javascript using
I am using jQuery slimbox with it's API . Here is my JavaScript that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.