Skatox
Skatox

Reputation: 4284

Facebook like button's iframe not expanded after ajax request

I'm adding a facebook share button to each post on a Wordpress (Using Facebook Share Button New plugin), it works ok for each post/page except when i'm loading them trough ajax, the result it's a normal Facebook like button but the popup (to write a comment) appears inside the button it is not expanded.

To check go to: http://iwanttobeher.com/ and then click on any face at the bottom of the page, then test the like button and you'll see what happens.

I don't know what to do, i tried to FB.XFBML.parse() after loading the content but the result is the same.

Upvotes: 0

Views: 564

Answers (2)

jamix
jamix

Reputation: 5628

Switching to HTML5 didn't help in our case. What did was to remove the FB object just prior to new content being inserted into the page via Ajax:

delete FB;
wrapper.html(response.data);

We reload full pages via Ajax and so new page content recreates the FB object and re-initializes XFBML anyway. Not sure if this workaround would work if we reloaded only parts of the page though.

The original answer is here.

Upvotes: 2

Skatox
Skatox

Reputation: 4284

I've managed to fix it by changing the implementation to HTML5 instead Iframe or XFBML using Facebook's tool to generate like buttons: https://developers.facebook.com/docs/reference/plugins/like/

Upvotes: 0

Related Questions