How can I dynamically add a facebook button using jquery? I plan to have a gallery and want to add such buttons for each image? I tried this but does nothing: $ ('. Share_button'). append ("(fb: like layout = 'button_count' font = 'tahoma') (/ fb: like)") where share_button is the class name of the div tag that will contain the type button.
Thanks in advance, Ivan
First of all, it should be:
$('.share_button').append("<fb:like layout='button_count' font='tahoma'></fb:like>")
Then you should add this line:
FB.XFBML.parse($('.share_button').get(0));
, , , , .share_button.
.share_button
XMLNS: = "http://www.facebook.com/2008/fbml"
, FB, . , SO