Search code examples
javascripthtmlfacebook-likeazure-web-app-service

Does facebook not support azure web sites?


I've added the code that has worked in the past to add a facebook "like" button to my latest site yet, although it does display the Tweet button, it does not display the facebook button.

Is it because facebook doesn't recognize and/or support azure web sites?

Here is my HTML/Javascript:

<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 style="display:inline-block;vertical-align:top">
    <a href="https://twitter.com/share" class="twitter-share-button" data-url="http://usamaporama.azurewebsites.net" data-text="Check out this USA map with sports teams, National Parks, and hometowns of authors and musicians" data-via="BClayShannon">Tweet</a>
    <script>
        !function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https'; if (!d.getElementById(id)) { js = d.createElement(s); js.id = id; js.src = p + '://platform.twitter.com/widgets.js'; fjs.parentNode.insertBefore(js, fjs); } }(document, 'script', 'twitter-wjs');
    </script>
</div>
<div style="display:inline-block;vertical-align:top" class="fb-like" data-href="http:/usamaporama.azurewebsites.net" data-send="false" data-width="450" data-show-faces="false" data-font="segoe ui"></div>

UPDATE

The Chrome Dev Tools console says: "FB.getLoginStatus() called before calling FB.init()." but I don't grok that, as searching my code for "getLoginStatus" finds nothing, nor does searching for "FB.init".


Solution

  • Check your browser's JavaScript console.

    Invalid App Id: Must be a number or numeric string representing the application id.