Reputation: 17467
I ma using the Facebook comment plugin
$('.fb-comments').attr('data-href', window.location.href);
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&appId=694645587257406&version=v2.4";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
In my template I have
<div class="fb-comments" data-href="" data-numposts="5" data-colorscheme="light"></div>
Because my data in is an modal window the issue I am having is while the url does update the comments do not update until I hit refresh. Is there a way for for a refresh when the href changes?.
I am using modal windows so the page never actually refreshes. Which is a nice effect I would like to retain.
Upvotes: 0
Views: 138
Reputation: 1956
It sounds like FB.XFBML.parse()
might be what you're looking for. That should re-render your comments plugin!
Upvotes: 1