Click here to Skip to main content
15,891,738 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hello , im trying to add facebook like to my website.
I have added facebook javascript SDK right after body tags using


<script type="text/javascript">
    window.fbAsyncInit = function() {
        FB.init({appId: 'my id i recieved', status: true, cookie: true, xfbml: true});
    };
    (function() {
        var e = document.createElement('script');
        e.type = 'text/javascript';
        e.src = document.location.protocol + '//connect.facebook.net/pt_PT/all.js';
        e.async = true;
        document.getElementById('fb-root').appendChild(e);
    }());
</script>



and after that adding button itself from facebook.developers

<div class="fb-like" data-href="https://developers.facebook.com/docs/plugins/" data-width="200" data-layout="button_count" data-action="like" data-show-faces="true" data-share="true"></div>


but the problem is the button does not show up. I just cant find the solution to this, not even on stackoverflow. Im opening it on localhost with wampserver.
Thanks for answers
Posted
Comments
Afzaal Ahmad Zeeshan 28-Jun-15 17:14pm    
Your domain address or code doesn't matter until you are well configured in the developer console on Facebook also. Did you try to debug your application?
Member 11378302 28-Jun-15 17:23pm    
no , im new to this kind of stuff , but my site isnt still only on local host , so in order to add facebook button i have to upload it on server?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900