I want to use the like facebook button in my website which is a static website ,when I add the script to the page it didn’t appear when I open the page without the wamp server
but when I add the share button of twitter it work even without wampserver why? where is the problem?
script for facebook:
<div class="fb-like" data-href="http://www.mywebsite" data-send="false" data-layout="button_count" data-width="450" data-show-faces="false"></div>
<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>
script for twitter
<a class="twitter-share-button" data-lang="en" data-url="http://mywebsite/">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
</script>
to render the facebook like button facebook will crawl into website and check if the URL provided is a valid web url. if the URL has ‘localhost’ mentioned then the like button will not display. you can also check if your site url has valid scrape by pasting your site URL in the below facebook developers page,
http://developers.facebook.com/tools/debug/og/object
map your ip from localhost to your domain name and it will render the like button