ASP.NET ページで Facebook の [いいね] ボタンが機能しません。FB開発者ツールを使用して、いいねボタンを表示するコードを生成しようとしましたが、AddThisも使用しようとしましたが、どちらも機能しません。私が試したことは次のとおりです。
1) FB のようなボタン ジェネレーター、IFRAME スタイルで生成
<html>
<body>
<iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.illuminephotos.co.uk%2Fblog.aspx&send=false&layout=standard&width=450&show_faces=true&action=like&colorscheme=light&font=segoe+ui&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>
</body>
</html>
2) FB のようなボタン ジェネレーター、HTML5 スタイルで生成
<html>
<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_GB/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
} (document, 'script', 'facebook-jssdk'));</script>
<div class="fb-like" data-href="http://www.illuminephotos.co.uk/blog.aspx"
data-send="false" data-width="450" data-show-faces="true" data-font="segoe ui"></div>
</body>
</html>
3) AddThis によって生成されます ( ASP.NET で動作するように<%=...%>
ブロックでわずかに変更されています) 。
<html>
<body>
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_facebook_like" <%="fb:like:layout"%>="button_count"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_button_google_plusone" <%="g:plusone:size"%>="medium"></a>
<a class="addthis_counter addthis_pill_style"></a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4f4c14fd1002be4d"></script>
<!-- AddThis Button END -->
</body>
</html>
どちらの場合も、1) と 2) は localhost で完全に機能します。[いいね] ボタンが表示され、クリックすると機能します。しかし、サーバーには何もありません。Firebug の Net コンソールには、「blog.aspx」の get しか表示されず、他には何も表示されません。
localhost 3) でも完全に動作し、FB、Twitter、G+、および AddThis ボタンが表示されます。しかし、サーバー上では、FB のない Twitter、G+、および AddThis のみです。
私はそれをグーグルで検索してSOを検索しましたが、困惑しています。Facebook は何をして、Twitter/G+ はしていないのですか? 何か案は?localhost では正常に動作するが、サーバーでは失敗するのはなぜですか?
(私のテスト URL はhttp://www.illuminephotos.co.uk/blog.aspxです)