0

So i am trying to add a like to my individual posts. So i added this to each of the posts. The posts are generated from database output then assembled with the properly styling in a javascript file.

So i added this to the creation mix.

<fb:like href="my_not_so_sweet_website" layout="button_count" show_faces="true" width="200"></fb:like>



Weird part is... None of them show up. THEN i try taking that code that i generated for each post and just copy and paste it to the top of my website, and low and behold A like Button!!!. Any clues? Need more info? Help?

2
  • The {} button is your friend :)
    – alex
    Mar 3, 2011 at 0:45
  • i do not get what your trying to say. Mar 3, 2011 at 1:01

1 Answer 1

3

You are using what's called FBML. The like button is rendered on the fly (well, on page load) by a facebook javascript libabry you include on the page- it needs the FBML tags to know what to render.

The problem is that the FB library isn't smart enough to know that you've dynamically added these FBML tags to the DOM.

There is another type of like button that's an iframe, that one should work if you put it in the DOM dynamically. Docs for that are here: http://developers.facebook.com/docs/reference/plugins/like/

-when you enter your info into the widget there will be an option for iframe.

There is also a FBML render function in the FB javascript SDK. Docs are here: http://developers.facebook.com/docs/reference/javascript/fb.xfbml.parse/

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.