我要添加the new facebook "like" button到我的 Blogger 网站。
我必须将 URL 传递给 iframe src
中的博客文章.
我可以从 <data:post.url/>
获取 Blogger 帖子 URL但我不能把它放在 src
中字符串,因为 Blogger 的模板系统很奇怪。
我想这样做:
<iframe allowTransparency='true' frameborder='0' scrolling='no'
src='http://www.facebook.com/plugins/like.php?href=<data:post.url/>&layout=standard&show-faces=true&width=450&action=like&colorscheme=light'
style='border:none; overflow:hidden; width:450px; height:px'/>
但 Blogger 提示:
Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
XML error message: The value of attribute "src" associated with an element type "null" must not contain the '<' character."
有人在用这个吗?
最佳答案
试试这个,
<iframe allowTransparency='true'
expr:src='"http://www.facebook.com/plugins/like.php?href=" + data:post.url + "&layout=button_count&show_faces=false&width=75&action=like&font=trebuchet+ms&colorscheme=light"'
frameborder='0' scrolling='no'
style='border:none; overflow:hidden; height: 20px'/>
关于facebook - 如何将 Facebook 的 "like"按钮添加到 Blogger 博客?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2686483/