2011-03-17 117 views

回答

1

试试addthis按钮。只是谷歌的。

3

首先定义这样在标签中加入一些属性:

> <html 
> xmlns="http://www.w3.org/1999/xhtml" 
> xmlns:fb="http://www.facebook.com/2008/fbml"> 

使用后此代码:

> <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> 

通过这个,你可以添加分享按钮。

0

你要插入你的 'APP_ID' 由Facebook开发人员接收到APP_ID:

<a href=" 
    https://www.facebook.com/dialog/share? 
     app_id=your_app_id 
     &display=popup 
     &href=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2F 
    &redirect_uri=https%3A%2F%2Fdevelopers.facebook.com%2Ftools%2Fexplorer"> 
<!-- your button image insert this --> 
</a> 

退房facebook developers site,部分 'URL重定向'。