我有网站新闻(单页应用程序)这个代码在aspx页面中很好
<div id="fb-root">
</div>
<script language="javascript" type="text/javascript">
(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&appId=1403512256546141";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<div class="fb-comments" style="width: 670px; float: left;" data-href="http://www.facebook.com/share.php?u=http://www.game11.com/%23/newsdetail/24" data-width="670" data-num-posts="10" dir="rtl" lang="aa">
</div>
Run Code Online (Sandbox Code Playgroud)
但如果在SPA中查看不包含html或body标签,我只能在单页应用程序中使用durandal
javascript facebook asp.net-mvc-4 single-page-application durandal