Facebook的分享按钮 [英] Facebook share button
本文介绍了Facebook的分享按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何获得Facebook的分享按钮?现在是一个天,他们没有显示得到code ..
How to get facebook share button? Now a days they not showing to get code..
推荐答案
首先定义了一些属性,在标签是这样的:
firstly defined some attribute in your tag like this:
> <html
> xmlns="http://www.w3.org/1999/xhtml"
> xmlns:fb="http://www.facebook.com/2008/fbml">
在使用这种code:
> <html
> xmlns="http://www.w3.org/1999/xhtml"
> xmlns:fb="http://www.facebook.com/2008/fbml">
>
> <head> <script
> src="http://connect.facebook.net/en_US/all.js"></script>
> <script
> src="http://static.ak.fbcdn.net/connect.php/js/FB.Share"
> type="text/javascript"></script>
>
> </head>
>
> <body> <div id="fb-root"></div>
>
> <a name="fb_share" type="box_count"
> href="http://www.facebook.com/sharer.php"
> tabindex="-1">Share</a> <script>
>
> //===========init javascript
> SDK===========================
>
> FB.init({appId: 'YOUR APP KEY',
> status: true, cookie: true, xfbml:
> true});
> FB.Event.subscribe('auth.sessionChange',
> function(response) {
> if (response.session) {
> // A user has logged in, and a new cookie has been saved
> } else {
> // The user has logged out, and the cookie has been cleared
> } });
>
> </script>
>
>
> </body> </html>
通过这样您可以添加分享按钮。
By this you can add share button.
这篇关于Facebook的分享按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文