Author Topic: How to add Facebook like box or button to bloggger- Solve XML Parse Error  (Read 1723 times)

Offline M_J

  • Administrator
  • Full Member
  • *****
  • Posts: 143
  • Karma: +0/-0
  • I can't stop!
    • View Profile
    • The Kenyan Best Forum
For a very long time now I have been fgacing problems adding Facebook like box or button to blogger. I always getting an error like,  Error parsing XML, line 658, column 62: The reference to entity "appId" must end with the ';' delimiter.

If you have been facing problems like this then I have your solution. The problem is that you have not stated your app id. You can do so by adding the code below to your Javascript SDK and your like box will appear.

Code: [Select]
<div id="fb-root"></div>
<script>
  window.fbAsyncInit = function() {
    FB.init({
      appId      : 'YOUR_APP_ID', // App ID
      channelUrl : '//WWW.YOUR_DOMAIN.COM/channel.html', // Channel File
      status     : true, // check login status
      cookie     : true, // enable cookies to allow the server to access the session
      xfbml      : true  // parse XFBML
    });

    // Additional initialization code here
  };

  // Load the SDK Asynchronously
  (function(d){
     var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
     if (d.getElementById(id)) {return;}
     js = d.createElement('script'); js.id = id; js.async = true;
     js.src = "//connect.facebook.net/en_US/all.js";
     ref.parentNode.insertBefore(js, ref);
   }(document));
</script>

Replace your App Id with your real one which can be gotten from the Facebook developers page
Replace 'yourdomain.com' with the home url of your blog.

Add your Like box or button code where you would like it to appear. An example code looks like this
Code: [Select]
<div class="fb-like-box" data-href="YOUR-FACEBOOK-PAGE-URL" data-colorscheme="light" data-show-faces="true" data-header="true" data-stream="true" data-show-border="true"></div>
Your Facebook like button or box should now show as required.
« Last Edit: November 02, 2013, 09:19:51 AM by decentbwoy »

Offline M_J

  • Administrator
  • Full Member
  • *****
  • Posts: 143
  • Karma: +0/-0
  • I can't stop!
    • View Profile
    • The Kenyan Best Forum
I have found using the iframe rather than the above method to be error free and easy. I would recommend it to the above one.

KenyanBestForum.com