Dynamically add facebook like button using jquery -
how can dynamically add facebook button using jquery? i'm planning have gallery , want add add buttons under every image? i've tried doesn't render anything: $('.share_button').append("(fb:like layout='button_count' font='tahoma')(/fb:like)") share_button classname of div tag contain button.
thanks in advance, ivan
first of all, should be:
$('.share_button').append("<fb:like layout='button_count' font='tahoma'></fb:like>")
then, should add line:
fb.xfbml.parse($('.share_button').get(0));
however, suggest use id instead of class, or codes above parse nodes containing class .share_button
.
Comments
Post a Comment