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 6158675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:59:51+00:00 2026-05-23T20:59:51+00:00

I need using javascript to check if the current user is fan of my

  • 0

I need using javascript to check if the current user is fan of my page.

I goto here https://developers.facebook.com/docs/reference/rest/pages.isFan/. In Test Console I don’t understand about Application parameter?

I using this code below, but it’s always alert “You like the Application” for any user even guest

window.checkDoesLike = function() {
  FB.api({ method: 'pages.isFan', page_id: '138992766181857' }, function(resp) {
    if (resp) {
      alert('You like the Application.');
    } else {
      alert("You don't like the Application.");
    }
  });
};
  • 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-23T20:59:53+00:00Added an answer on May 23, 2026 at 8:59 pm

    I’ve written an extended tutorial about this here.

    There are a couple of points to highlight:

    1. You are missing the uid parameter
    2. using if(resp) is not enough

    Better code:

    FB.api({ method: 'pages.isFan', page_id: 'page_id_here', uid: 'user_id_here' }, function(resp) {
        if (resp == true) {
          alert('user_id likes the Application.');
        } else if(resp.error_code) {
          alert(resp.error_msg);
        } else {
          alert("user_id doesn't like the Application.");
        }
    });
    

    Quoting:

    Once again, you need to check the response of the call if true or
    not…using if(resp) is NOT enough! The example in the Facebook
    JavaScript Test Console
    is a bit misleading (the does-like example),
    since if you don’t grant the user_likes permission and just try it
    with uid: ‘579187141’ it would result that the user likes the
    application which is not true!
    P.S: I just decremented my user id to get the above user which (it
    seems) he has a strict privacy for pages he likes!

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

Sidebar

Related Questions

I need to edit (using javascript) an SVG document embedded in an html page.
I am using javascript to validate user input on my aspx page. I am
Is it possible to check (using PHP or Javascript) if a user is logged
Using JavaScript, I need to check if a given string contains a sequence of
I need to connect to an asmx webservice using javascript. the webservice accepts and
I need to round decimal numbers to six places using JavaScript, but I need
I have a <select>. Using JavaScript, I need to get a specific <option> from
I am using jQuery and JavaScript, I need to call the jQuery function inside
I'm working on a FBML fan page for a client. I need to perform
Current scenario: I'm using the gmail oauth api to receive emails on a page.

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.