Append Facebook like button

I want to append a Facebook like button to a certain div using dynamic URL's. Please take a look at this simple example for dynamic URL: JsFiddle

So now I put the code inside ajax call but it doesn't work: JsFiddle

The weird thing is that when I look at the source with chrome developer I can see the like button with appropriate URL is there. But it doesn't show because dimensions are 0 x 0 ...

Answers


Related stackoverflow post: Why is my Facebook Like button broken?

Because the facebook script goes through the DOM to get the like buttons, and you've added these buttons after the fact, you have to tell it to look again. It would appear that FB.XFBML.parse(); would be the key to this.


Need Your Help

kobold2d disable full screen on orientation change

cocos2d-iphone uikit kobold2d

I want to include cocos2d scene besides UIKit GUI elements in my app using kobold2d library, so it should take just part of the screen.

Mapping maps in Hibernate using JPA2

hibernate map hbm2ddl

I am trying to map a java.util.Map with Hibernate, but can't seem to get it right. I am using Hibernate 4.2.8.Final and hibernate3-maven-plugin 2.2. Originally I wanted to have a map keyed by an

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.