5 Replies - 1574 Views - Last Post: 06 March 2013 - 01:36 PM

#1 Planet Telex  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 37
  • Joined: 15-November 10

Placing Facebook 'Like' Button into website NOT WORKING?

Posted 05 March 2013 - 08:29 PM

I understand that this is probably the wrong place to be asking this question...

So I've created the code for the Facebook "Like" button and copied and pasted both into the body of an html doc and lo and behold, it is not showing up. What am I doing wrong?


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>
</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_US/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-like" data-href="http://www.facebook.com/pages/Paragon-Cleaning-Services/541055149251371?fref=ts" data-send="true" data-width="450" data-show-faces="true" data-colorscheme="dark"></div></body>

</html>



Is This A Good Question/Topic? 0
  • +

Replies To: Placing Facebook 'Like' Button into website NOT WORKING?

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6058
  • View blog
  • Posts: 23,496
  • Joined: 23-August 08

Re: Placing Facebook 'Like' Button into website NOT WORKING?

Posted 06 March 2013 - 04:12 AM

Aren't you missing the http: here?

js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";

Was This Post Helpful? 0
  • +
  • -

#3 DocNet  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 74
  • Joined: 11-October 12

Re: Placing Facebook 'Like' Button into website NOT WORKING?

Posted 06 March 2013 - 07:17 AM

View PostPlanet Telex, on 05 March 2013 - 08:29 PM, said:

I understand that this is probably the wrong place to be asking this question...

So I've created the code for the Facebook "Like" button and copied and pasted both into the body of an html doc and lo and behold, it is not showing up. What am I doing wrong?


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>
</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_US/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-like" data-href="http://www.facebook.com/pages/Paragon-Cleaning-Services/541055149251371?fref=ts" data-send="true" data-width="450" data-show-faces="true" data-colorscheme="dark"></div></body>

</html>



this code, put in head tag.
<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/all.js#xfbml=1";
	  fjs.parentNode.insertBefore(js, fjs);
	}(document, 'script', 'facebook-jssdk'));</script>

Was This Post Helpful? 0
  • +
  • -

#4 Planet Telex  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 37
  • Joined: 15-November 10

Re: Placing Facebook 'Like' Button into website NOT WORKING?

Posted 06 March 2013 - 10:36 AM

Thank you for the responses. They did not work unfortunately. I do get the following errors... In XHTML 1.0 data-ref, data-send, data-width, data-show-faces, data-colorscheme aren't permitted. I assume this is the problem. How can this be remedied?
Was This Post Helpful? 0
  • +
  • -

#5 Planet Telex  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 37
  • Joined: 15-November 10

Re: Placing Facebook 'Like' Button into website NOT WORKING?

Posted 06 March 2013 - 11:20 AM

View PostPlanet Telex, on 06 March 2013 - 10:36 AM, said:

Thank you for the responses. They did not work unfortunately. I do get the following errors... In XHTML 1.0 data-ref, data-send, data-width, data-show-faces, data-colorscheme aren't permitted. I assume this is the problem. How can this be remedied?


not permitted within the div tag I mean
Was This Post Helpful? 0
  • +
  • -

#6 Planet Telex  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 37
  • Joined: 15-November 10

Re: Placing Facebook 'Like' Button into website NOT WORKING?

Posted 06 March 2013 - 01:36 PM

scratch that... it does work. It just doesnt work for the preview. I actually have to upload it to the site and view it from there. Strange.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1