$( document ).ready(function() { $('#showComment').on('click',function(){ $('#facebookComment').show(function(){ //remove the comment to see the comment box appear //FB.XFBML.parse(); }); }); });
<div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/es_LA/all.js#xfbml=1&appId=651565091531466"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <div id="facebookComment"> <div class="fb-comments" data-href="http://example.com/comments" data-numposts="5"></div> </div> <button id="showComment">Show comment</button>
#facebookComment { display:none; }