I have an AJAX response that contains some HTML, including elements.
This HTML should replace an existing element, but when I use:
This code is from facebook's sample app. Insert in your document. The code requires jQuery to load up the script. In your case, replace //connect...../all.js' with the elements.
(function() {
var e = document.createElement('script');
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());