2010-06-17 77 views

回答

1
<iframe frameborder="0" scrolling="no" allowtransparency="true" style="border: medium none; overflow: hidden; width: 150px; height: 20px;" src=" http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.yoursiteurlencodedhere.com&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=dark&amp;height=80"></iframe> 

注意到的:HTTP%3A%2F%2Fwww.yoursiteurlencodedhere.com部分。

0

這是不可能通過Facebook的API。上面的iframe解決方案可能工作。

0

下面是添加Facebook like按鈕的詳細信息。

http://developers.facebook.com/docs/reference/plugins/like/

您可以使用iframe的方法:

<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fexample.com%2Fpage%2Fto%2Flike&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe> 

或者你可以使用XFBML方法:

<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like show_faces="true" width="450"></fb:like> 

我個人認爲XFBML方法是清潔劑。不幸的是,這不會主動提示用戶,它只是將按鈕添加到您的頁面。他們無法提示某人。