Home » , , , , » How to Fix Error Parsing XML When Adding Facebook Like Box (Page Plugin) on Blog/Website

How to Fix Error Parsing XML When Adding Facebook Like Box (Page Plugin) on Blog/Website

As you may already know, the Facebook like box will deprecated and will stop working effective on June 23, 2015. Instead of the Like Box, Facebook will let you use their new Page Plugin so that you can embed a a simple feed of content from a Page into your websites.

Well, it's not really different with the Like Box. Instead, it feels like the Like Box but only differs on looks. In fact, we are loving the new look as it's simple but yet elegant. Take a look at our Facebook Plugin Page below:
How to apply Facebook Page Plugin on your blog/website.

It's really simple. Just like the what you've did on the later Facebook Like Box page, all you need to do is enter your page URL, then select your desired width and height for your widget, then check some necessary boxes and then get code.

Once you've get the code, you will be instructed to:

1. Include the JavaScript SDK on your page once, ideally right after the opening. <body> tag.

Your unique Javascript SDK code

2. Place the code for your plugin wherever you want the plugin to appear on your page.

Your unique div-tag code

The problem...

The problem sometimes on implementing this onto your website is sometimes, you will get this error (especially on blogger):

Error parsing XML, line 884, column 64: The reference to entity "version" must end with the ';' delimiter.

How to fix this...

It's simple. All you need to do is tinker some lines on the Javascript SDK code.

The standard Javascript SDK code is this:
<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/en_US/sdk.js#xfbml=1&version=v2.3";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
All you need to do is replace the 6th line of the code, with this:
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&amp;version=v2.3";
So your new Javascript SDK code will be:
<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/en_US/sdk.js#xfbml=1&amp;version=v2.3";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
Then paste the code right after the opening <body> tag on your blog and it will now work.