0

I have the basic FB.init code for the Facebook API first thing in the body.

<script type='text/javascript'>
window.fbAsyncInit = function() {
    FB.init({
      appId      : '175503852952133',
      xfbml      : true,
      version    : 'v2.8'
    });
    FB.AppEvents.logPageView();
  };

  (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/en_US/sdk.js";
     fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));
</script>

I also have an embedded like button and facebook video on the page. Whenever the page loads everything is displayed as it should, but once the page has been refreshed (either through the refresh button or F5) the embedded like and video do not show up. As if the FB.init has not been ran. Reloading the site with Ctrl + F5 fixes it, but it's not the solution I need.

Alexander Dimitrov
  • 121
  • 1
  • 1
  • 7
  • Can you show an example page? Does this happen in all browsers, or specific ones? – CBroe Feb 27 '17 at 12:28
  • Of course, here's the original page: http://thecardinal.uphero.com/ This happens in Chrome, when reloading or switching between pages of the website. In IE (MS Edge) and Firefox it only happens when I switch between pages. To switch between the pages I use jQuery to load a certain .html file into a div. You can see the function at http://thecardinal.uphero.com/src/scripts.js (ignore the fbIni function, it isn't being used) – Alexander Dimitrov Feb 28 '17 at 09:12
  • _“To switch between the pages I use jQuery to load a certain .html file into a div”_ – then you need to instruct the SDK to re-parse your document after you inserted new content that contains social plugins. See the duplicate. – CBroe Feb 28 '17 at 09:21

0 Answers0