Note that there are some explanatory texts on larger screens.

plurals
  1. POFacebook comments inside lightbox plugin (facebox) show up only once
    primarykey
    data
    text
    <p>So I'm working in a project that involves opening a lightbox whenever I click in some specific items. this lightbox renders, using ajax, some php file with a GET parameter (an id) identifying a unique set of data that shows up (address, category, images, etc). I'm trying to include facebook comments inside this lightbox (it's <a href="http://defunkt.io/facebox/" rel="nofollow">facebox</a>), and it all seems to work fine, except for the fact that the comments plugin shows up only once, no matter what. I.e, when I click on an item for the first time, everything is good. The second time I click on <em>any</em> item, the lightbox doesn't show the facebook comments.</p> <p>.::Codes::.</p> <p>The facebook script, slightly modified so the actual facebook script ends up inside the content of the lightbox:</p> <p>the HTML for the comments (testing it in localhost, but I already tried it online, with no difference):</p> <pre><code>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)){ FB.XFBML.parse(); return; } js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/es_LA/all.js#xfbml=1&amp;appId=306357209496269"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); ... &lt;div id="fb-root"&gt;&lt;/div&gt; &lt;div class="fb-comments" data-href="http://localhost/inmobiliaria/propiedad.php?propId=&lt;?php echo $id?&gt;" data-width="470" data-num-posts="10"&gt;&lt;/div&gt; </code></pre> <p>I also tried keeping the script in the parent document (the index page), and confirmed the scripts brought by the lightbox re-execute every time.</p> <p>What can I do to make the facebook comments plugin always show up inside the lightbox?</p> <p>UPDATE: I managed to "fix" this issue, i.e., the comments plugin actually shows up in every lightbox (added the parse function of the FB api, see the code above). The problem is, only the first one is correctly sized. The rest is always at height:160px and it doesn't update its height if I add another comment.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload