最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Facebook Face Pile Using HTML5 Instead of iFrame - Stack Overflow

programmeradmin1浏览0评论

Is it possible to use a Facebook Face Pile pointing to an APP-ID instead of a HREF through the JavaScript API? For example, what would the JavaScript equivalent of the iFrame code:

<iframe src=".php?app_id=120600291315567"
  style="border:none; overflow:hidden; width:300px; height: 70px">
</iframe>

Is it possible to use a Facebook Face Pile pointing to an APP-ID instead of a HREF through the JavaScript API? For example, what would the JavaScript equivalent of the iFrame code:

<iframe src="http://www.facebook./plugins/facepile.php?app_id=120600291315567"
  style="border:none; overflow:hidden; width:300px; height: 70px">
</iframe>
Share Improve this question edited Dec 5, 2011 at 18:19 Kevin Sylvestre asked Dec 4, 2011 at 0:59 Kevin SylvestreKevin Sylvestre 38.1k33 gold badges156 silver badges235 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 7

To show how many friends are using your website/app, just use the HTML5 example generated at https://developers.facebook./docs/reference/plugins/facepile/ and then remove the data-href attribute. Example:

<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/en_GB/all.js#xfbml=1&appId= 120600291315567";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>


<div class="fb-facepile" data-width="200" data-max-rows="1"></div>

The data-href attribute signifies that you want to show how many people have liked that specific URL instead.

<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/en_GB/all.js#xfbml=1&appId= 120600291315567";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>


<div class="fb-facepile" data-href="http://example." data-width="200" data-max-rows="1"></div>

this actually shown in the social plugin docs in facebook.

发布评论

评论列表(0)

  1. 暂无评论