I'm trying to add a FB like button for recommendations to an AJAX driven search page.
I've already implemented it successfully in a static template, but it seems to be more complicated to implement dynamically changing likes on a single page.
is there a way to inject the .fb-like template to the page dynamically and make facebook render it to create the necessary IFRAME? Clearly facebook does it onload, but can it be triggered manually with JS?
The original FB html to be embedded:
<div class="fb-like" data-href="http://mattat.org.il/ci/index.php/
search/show_full/nsrecommendation/{{q}}"
data-send="true" data-layout="button_count"
data-width="450" data-show-faces="true" data-font="arial"></div>
The {{q}} will be dynamically replaced with the current recommendation id