0

I want to check the status of Facebook like button on my web page. I want to this completely on client side without querying anything (if possible)

One idea is to check the style of the page. I have seen that there is an element with class "... like_button_like" or "...like_button_no_like" depending of the status. Is there a way to query this?

As I said, I don't want to delve into querying Facebook for this with FQL or anything else.

paul simmons
  • 5,568
  • 13
  • 51
  • 78

2 Answers2

3

No. This is not possible without connecting user with your application. You doesn't need any additional permissions for that.

You cannot check for DOM elements class attribute since it resist in iframe which is served from facebook.com and cross-domain policy does't allow you to do this.

Juicy Scripter
  • 25,778
  • 6
  • 72
  • 93
0

enter code hereIf we want to check user does like facebook page, we may use Javascript like this:


    FB.api({ method: 'pages.isFan', page_id: 'YOUR-PAGE-ID' }, function(resp) {
        if (resp) {
          alert('You like the Application.');
        } else {
          alert('You don't like the Application.');
        }
     });

But if we want to know if use does like our website (not facebook page) we may use our own database to store user id when user click like, or click unlike.

Ratha Hin
  • 37
  • 1
  • 6