Reputation: 7433
So I went through the facebook documentation found here, but my share button still isn't showing up.
I added this directly beneath the body tag in my _layout.cshtml
page:
<div id="fb-root"></div>
script
window.fbAsyncInit = function () {
FB.init({
appId: 'xxxxxxxxxxxxxxxx',
status: true,
xfbml: true
});
};
(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";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
script
(I removed the less than/greater than around the script tag in order to get the code block to show up on SO)
And I added this to my homepage for testing purposes:
<div class="fb-share-button" data-href="http://myurl.com" data-width="50px" data-type="button_count">Share</div>
I have to add in the text for the div element just to "see" the "Share" text.
Where am I going wrong? I figured adding the facebook widget thing would provide the facebook image/icon and share count, am I wrong?
Upvotes: 1
Views: 2883