jimmyp1399473
jimmyp1399473

Reputation: 27

like button not appearing

So this is kind of strange to me, hopefully somebody can help me out.

When I add this code below to a html page and then open it, the like button does not appear. But when I do it in jsfiddle it works http://jsfiddle.net/wZFss/ Anybody got any ideas what might be wrong?

Thanks, J

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    </head>
<body>
<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_GB/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<div class="fb-like" data-href="http://www.diabolotricks.net" data-send="false" data-layout="button_count" data-width="450" data-show-faces="false"></div>
<p>helloworld</p>
</body>
</html>

Upvotes: 1

Views: 1058

Answers (1)

ShawnDaGeek
ShawnDaGeek

Reputation: 4150

You have your doc type set to xhtml 1.1 and your using the html5 button code.

You will either need to use, iframe button, xfbml button or change your doc type to html5.

refer to: http://www.w3.org/QA/2002/04/valid-dtd-list.html

refer to: https://developers.facebook.com/docs/reference/plugins/like/

Upvotes: 1

Related Questions