Facebook comments won't be displayed, if you container is display:none
, which is the case of non-default tab.
An alternative that I used was to not render the fb comments, until the container is displayed. This can be acheived by using,
window.fbAsyncInit = function () {
FB.init({
xfbml:false // Will stop the fb like button from rendering automatically
});
};
Then to render the fb comments, you can use
FB.XFBML.parse(); // This will render all tags on the page
//or the following is a Jquery example on how to render all XFBML within an element
FB.XFBML.parse($('#profile')[0]); // profile is the id of element which contains the fb code
// In plain js,
FB.XFBML.parse(document.getElementById("profile"));
Reference: Code from a SO answer.