问题
I've added some like buttons on my personal web page: edoardo.torreggiani.net but only one button works fine.
THIS WORKS (homepage):
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fedoardo.torreggiani.net&send=false&layout=button_count&width=100&show_faces=false&action=like&colorscheme=light&font&height=21&locale=en_US" scrolling="no" frameborder="0" style="border: none; overflow: hidden; width: 100px; height: 21px; " allowtransparency="true"></iframe>
THIS DOESN'T WORK (single post in homepage):
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fedoardo.torreggiani.net%2Fhome%3Fpost%3D5&send=false&layout=button_count&width=100&show_faces=false&action=like&colorscheme=light&font&height=21&locale=en_US" scrolling="no" frameborder="0" style="border: none; overflow: hidden; width: 100px; height: 21px; " allowtransparency="true"></iframe>
When I click on the like button that doesn't work I obtain that response :
for (;;);{"__ar":1,"payload":null,"jsmods":{"require":[["Plugin","disconnect",[],["http:\/\/edoardo.torreggiani.net\/home?post=5"]]]}}
The only difference between the working one and the wrong one is the HREF param in iframe src: the wrong one has one parameter in query string.
回答1:
As far as i can see, there is no real page for every blogpost. Your post link is this one:
http://edoardo.torreggiani.net/home?post=5
Put that in the debugger and you will see errors:
https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fedoardo.torreggiani.net%2Fhome%3Fpost%3D5
Object at URL 'http://edoardo.torreggiani.net' of type 'website' is invalid because the given value '10150406244527145' for property 'fb:admins' could not be parsed as type 'fbid'.
来源:https://stackoverflow.com/questions/13159174/facebook-like-button-doesnt-increment