Title should be load ajax inside ajax because facebook comments load via ajax
I am building an all AJAX site for a Facebook iFrame page and am having an issue. All the pages and what not load up dynamically just fine, but some pages use the Facebook commet system. After the AJAX has loaded the page though, the JavaScript inside does not load.
This is the Facebook comment script that I need to load inside the ajax'd content.
How would you eval that? (or whatever it is you would do?)

  var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
  js = d.createElement('script'); js.id = id; js.async = true;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
<div class="fb-comments" data-href="<?php the_permalink(); ?>" data-num-posts="5" data-width="500"></div>

Any help greatly appreciated.

Edited by epicrevolt: n/a

6 Years
Discussion Span
Last Post by stevenson.nelli

I am tring to display xml file in html div but that html file does not contains internal script .How cani do that?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.