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

  • SEARCH
  • Home
  • 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 6947469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:41:49+00:00 2026-05-27T13:41:49+00:00

I created a Facebook app mostly built in jQuery. I need to now check

  • 0

I created a Facebook app mostly built in jQuery. I need to now check if a user liked a particular page. However, this needs to be added to a jQuery click() function (so if the user clicks on the button, it will give a dialogue stating they cannot continue without liking the page) and effectively stops the script from running.

My entire application uses jQuery, it’s not different pages, so I really need interaction between jQuery and Facebook JSDK but I am not sure how the integration will work. Does anyone have useful resources for me to have a look at? Or perhaps a 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-27T13:41:50+00:00Added an answer on May 27, 2026 at 1:41 pm

    use this:

    $(document).ready(function() {
    
        window.fbAsyncInit = function() {
            FB.init({
              appId      : 'YOUR_APP_ID', // App ID
              channelURL : '//www.YOUR_DOMAIN.com/channel', // Channel File URL
              status     : true, // check login status
              cookie     : true, // enable cookies to allow the server to access the session
              oauth      : true, // enable OAuth 2.0
              xfbml      : true  // parse XFBML
            });
    
            FB.getLoginStatus(function(response) {
                  if (response.authResponse) {
                    // logged in and connected user, someone you know
                     var user_id = response.authResponse.userID;
                      var page_id = "YOUR_PAGE_ID";
                      var fql_query = "SELECT uid FROM page_fan WHERE page_id = "+page_id+"and uid="+user_id;
                      var the_query = FB.Data.query(fql_query);
    
                      the_query.wait(function(rows) {
    
                          if (rows.length == 1 && rows[0].uid == user_id) {
                              //user likes the page
                              //do your stuff here
                          } else {
                            // user doesn't like our page yet                             
                          }
                      });
                  } else {
                    // no user session available, someone not known, not logged into fb                  
                  }
              });
          };
    
          // Load the SDK Asynchronously
          (function(d){
             var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
             js = d.createElement('script'); js.id = id; js.async = true;
             js.src = "//connect.facebook.net/en_US/all.js";
             d.getElementsByTagName('head')[0].appendChild(js);
           }(document));
    });
    

    And in your html/jsp/php, add this line:

    <div id="fb-root"></div>
    

    Channel file is not mandatory but advisable. Check fb docs for more info.

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

Sidebar

Related Questions

I've created a simple Facebook app that doesn't need any data/info from users. When
I followed this guide and I've created my app successfully with Facebook integration. What's
I have created a simple Facebook app and added it as a tab page.
I have created topbar like Facebook app now I'm stuck I want to create
So I created a facebook app, I then have a user give permission for
I am trying to tag my facebook-app user in the photo created by the
I created a facebook app and i configured the following: IFrame Size: Resizable Canvas
Using this: Can I use Facebook's fb:friend-selector in an iframe? I created a multi-friend
We have created a facebook-app which contains a fb:comment field. We have included the
I have created a facebook application for App on Facebook and Website I am

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.