-1

Possible Duplicate:
How to check if a user likes my Facebook Page or URL using Facebook's API

how can i show or display information only if the user is fan or likes my page without using fbml. I have some old code there.

Something like:

<fb:visible-to-connection>
    Show content to the user
    <fb:else>
        <div style="position:absolute; top:0; left:0;">
               Like the page inorder to view the content.
        </div>
    </fb:else>
</fb:visible-to-connection>

But fbml has been deprecated, I need to this by javascript without using server related code, like php or aspx.

Thanks for any help.

And forgive my bad english.

Community
  • 1
  • 1
carcargi
  • 516
  • 2
  • 8
  • 23

2 Answers2

1

Attach a handler function to the facebook like buttons click event that enables displaying of the data.

But without actually checking with the facebook servers you cannot be sure and therefore a user can always fake it by just calling the javascript function displaying the information, for which you don't check if the user behaves.

Gung Foo
  • 13,392
  • 5
  • 31
  • 39
  • Thanks. But how do I keep on showing the information when they reenter the page. I need to check if they like. Not the like action. – carcargi Sep 27 '12 at 22:15
  • then ask the facebook server or save the fact that the user clicked it in YOUR database via an ajax called spawned upon click on the like button. – Gung Foo Sep 27 '12 at 22:24
0

There is a detailed explanation of how to accomplish this using only Javascript at Facebook how to check if user has liked page and show content?

Community
  • 1
  • 1
Kelvin
  • 5,227
  • 1
  • 23
  • 36