Facebook Like Button Removal

Hi everyone!

I’m building my first site and was wondering if you guys could help me out. What I’m trying to do is have a facebook like button on my site, and I’d like it to disappear or hide from my site after a user clicks it.

I’m really hoping someone here can help point me in the right direction.

Below is the facebook button code.

<iframe class="fb_foot" src="http://www.facebook.com/plugins/like.php?href=http%3A%1F%2Fxyxyxy.com&amp;layout=button_count&amp;show_faces=false&amp;width=60&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;" allowTransparency="true">
</iframe>

You can use the FB JavaScript API to subscribe to events.

http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe

I’m not 100% sure on this, but you might need to use the XFBML code to get it to work (TBH, the XFBML + OpenGraph + JS API’s are much nicer to work with than the iframes)

e.g.:


<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
<fb:like href="http://example.com" show_faces="true" width="200"></fb:like>

(http://developers.facebook.com/docs/reference/plugins/like)