`

Facebook之Social Plugins

阅读更多

Facebook之Social Plugins

什么是Social Plugin
引用
Social plugins
    Social plugins enable you to provide engaging social experiences to your users with just a line of HTML. Because the plugins are served by Facebook, the content is personalized to the viewer whether or not they have signed into your site.

简单地说:你想在你网站的某个网页上显示一个按钮、一小块html代码等来链接Facebook应用,那么只要引入facebook的API和一段fbml就可以达到目的。
Php代码:
  1. <html>   
  2.     <body>   
  3.         <div id="fb-root"></div>   
  4.     </body>   
  5. </html>   
  6. <script>   
  7.   // 116344281725102 是一个facebook应用的app id.   
  8.   window.fbAsyncInit = function() {   
  9.     FB.init({appId: '116344281725102', status: true, cookie: true,   
  10.              xfbml: true});   
  11.   };   
  12.   (function() {   
  13.     var e = document.createElement('script');    
  14.     e.async = true;   
  15.     //e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';   
  16.     e.src = 'http://connect.facebook.net/en_US/all.js';   
  17.     document.getElementById('fb-root').appendChild(e);   
  18.   }());   
  19. </script>   
  20. <fb:login-button></fb:login-button>  
浏览器中运行看看结果 :

分享到:
评论

相关推荐

    facebook api源码

    9. **Social Plugins**: Facebook提供了一系列社交插件,如Like按钮、分享按钮和评论框,可以直接嵌入到网站中,增加互动性。 10. **Facebook Login**: 应用可以集成Facebook Login,让用户使用Facebook账户...

    FacebookApp开发教程

    - **Social Plugins**:Facebook提供的一系列插件,如Like按钮、评论插件等,用于增加网站或应用的社会化特性。 - **Open Graph**:一种标准,用于定义应用的动作和对象,使用户在使用应用时能够创建动态(stories)...

    facebook 开发操作

    5. **Social Plugins**:Facebook提供了多种社交插件,如“Like”按钮、“分享”按钮、评论框等,这些插件可以方便地嵌入到网站中,增加互动性。 6. **JavaScript SDK**:Facebook提供了JavaScript SDK,使得在网页...

    fb_open_platform

    3. **Social Plugins**:如“Like”按钮、“分享”按钮和“评论框”,它们可以直接嵌入到第三方网站上,使用户无需离开网站就能与Facebook互动。 4. **Facebook Login**:提供了一种统一的身份验证机制,用户可以...

    10 jQuery Plugins and Techniques for Doing More with Images

    本文将围绕“10 jQuery Plugins and Techniques for Doing More with Images”这一主题,深入探讨如何利用jQuery插件和技术来增强网页中的图片功能。** 1. **Image Resizing and Cropping** - jQuery提供了多种...

    vuepress-plugin-social-share:VuePress的社交共享插件

    Vuepress插件社交分享 :megaphone: 社交共享插件 :open_book: ... plugins : [ 'social-share' ] , } :magnifying_glass_tilted_left: 现有技术 非常感谢提供了组件api源代码。 执照 :copyright:@

    jQuery网站侧边栏分享按钮特效.rar

    例如,Facebook的"Like"按钮可以通过其Social Plugins实现,而Twitter的"Tweet"功能则依赖于Twitter的Share Button。开发者需要理解这些API的工作原理,并将它们整合到jQuery事件处理函数中,确保用户点击按钮后能...

    IOS Native 8.4

    Social Sharing * Facebook Post * Twitter Post * Native Sharing Dialog * Sending e-mail * Documentation Apple TV * tvOS InApps * tvOS Game Center Post * tvOS iCloud * tvOS Gesture ...

    jQuery网页弹出层分享按钮插件

    例如,对于Facebook,可以使用其Social Plugins中的"Share Dialog";对于Twitter,可以利用"Share Tweet"功能。这些API允许开发者在用户点击分享按钮后,打开一个新的窗口或弹出层,预填充相应的分享信息,如网页URL...

    Springboot qq第三方登陆

    &lt;artifactId&gt;spring-boot-starter-social-facebook &lt;groupId&gt;com.github.scribejava&lt;/groupId&gt; &lt;artifactId&gt;scribejava-apis &lt;version&gt;YOUR_VERSION ``` 3. **配置QQ连接** - 在`application....

    sdk

    2. **API接口**:例如Google Maps API,允许开发者在网页中嵌入地图,或者Facebook的Social Plugins SDK,帮助集成社交功能。 3. **工具集**:包括编译器、调试器、性能分析工具等,帮助开发者进行代码优化和问题...

    Unity插件:iOS Native 8.1

    Social Sharing * Facebook Post * Twitter Post * Native Sharing Dialog * Sending e-mail * Documentation iAd App Network * Banners * Interstitials * 9 Gravity Options supported * Ability to ...

    Ionic : Hybrid Mobile App Development

    You will work through three complete projects and build a basic to-do list app, a London tourist app, and a complete social media app. All three projects have been designed to help you learn Ionic at ...

    CordovaShare

    social: 'socialNetworkName', // 可选,如'facebook', 'twitter' successCB: function() { console.log('分享成功'); }, errorCB: function() { console.log('分享失败'); }, cancelCB: function() { console....

Global site tag (gtag.js) - Google Analytics