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

Is it possible to use a Facebook Face Pile pointing to an APP-ID instead of a HREF through the JavaScri

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745405060a4626277.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信