How can I load an FB like button, preferably in an iframe?
I am trying to include http://jonathanscorner.com/like.cgi?url=http%3A%2F%2Fjonathanscorner.com in an iframe, and when I load the URL by itself, it reports errors (the "Like" doesn't stick) and says to lint it, but I can't tell from the linter what would be causing trouble (other than people being unable to give multiline comments).
How can I get this working, and/or is there a way to include it with a document.write()-based JavaScript include, evil as it may be? The URL above is something like a minimal test case that shows some of the same problems as when I was trying to work from document.write(), but without including any dirty programmer's t开发者_如何学Goricks on the page.
If you go to this page: http://developers.facebook.com/docs/reference/plugins/like/ and type in your url and click get code, then choose the iframe option from the code drop down you'll see:
<iframe src="//www.facebook.com/plugins/like.php?app_id=153916771364199&href=http%3A%2F%2Fjonathanscorner.com%2Flike.cgi%3Furl%3Dhttp%253A%252F%252Fjonathanscorner.com&send=false&layout=standard&width=450&show_faces=true&action=like&colorscheme=light&font&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>
Make sure that's your app id in the iframe, and set up OG tags on your page to help the linter pull in the data properly.
精彩评论