facebook like button flashing on then off
I cannot get the Like button to work on one site.开发者_C百科 http://www.room13canada.ca/test.html When the button is clicked it fires off to facebook but the callback then undoes the call? I have stripped all code to make sure there is no js or css or whatever breaking the button. please look at the pagesource - it makes no sense why it doesn't work.
if I change
<fb:like href="www.room13canada.ca"
to
<fb:like href="www.cnn.com"
it works like a charm??
any help would be great
Have you considered trying with the iframe
method?
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.room13canada.ca%2Ftest.html&layout=standard&show_faces=true&width=450&action=like&colorscheme=light&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>
Well, I was also having problems with the facebook like plugins and also heard from people that it is a facebook bug. After searching a lot on gOOgle .... I found a good result and don't think that this is a fb bug.
You will have to add this file into the header of your website:
<meta property="og:image" content="http://ia.media-imdb.com/images/rock.jpg" />
Property of Meta Tags (facebook likes Meta Tags) ==> og:image - An image URL which should represent your object within the graph.
Replace "http://ia.media-imdb.com/images/rock.jpg" with real path to image.
For Wordpress Users:
Add the following code in the head of your header file ==>
<?php $img= get_post_meta($post->ID, 'image', true); if ($img): ?>
<meta property="og:image" content="<?=$img ?>"/>
<? endif; ?>
That's all... Hope this will work for you all !! Share your experience ...
First, I'll give my hypothesis: If the Facebook URL Scraper has tried to scrape your page, and was unable to access it (e.g., if it was pending moderation and the Facebook Scraper bot got redirected to a "login" page), Social Plugins like the Like button and Comments won't work because Facebook thinks the URL is "inaccessible." It takes 24 hours for Facebook to try scraping the page again--until then, Facebook will assume it's still inaccessible.
Here's what Facebook says about how often pages are scraped and how to force a scrape:
Facebook scrapes your page every 24 hours to ensure the properties are up to date. The page is also scraped when an admin for the Open Graph page clicks the Like button and when the URL is entered into the Facebook URL Linter. Facebook observes cache headers on your URLs - it will look at "Expires" and "Cache-Control" in order of preference. However, even if you specify a longer time, Facebook will scrape your page every 24 hours.
Note that the Facebook URL Linter has been renamed the Facebook Object Debugger.
I could be wrong about the underlying issue. I'll give you my experiences, and you can decide.
Our site is a collection of blogs, and all blog posts have a "like" button, generated with identical code (except for the URL being liked). By default, all blog posts are saved to a "draft" state, and not available unless you are logged in. If an anonymous user attempts to visit a "draft" blog post, he will be redirected to the login page.
Months ago, we experienced a "Like" button problem, although the error manifested slightly differently: we got "URL inaccessible" when clicking the Like button. This only happened on posts that had "Like" buttons and also were not immediately published (e.g., they were saved to a "Draft" state). I thought this was fixed when I changed the "Draft" view to not display Facebook social plugins.
However, I've noticed that, from time to time, if you click the "Like" button on a particular post, the "Like" flyout flashes on the screen for a moment and then disappears, with no "like" action taking place. Different behavior, same problem: "Like" button doesn't work.
At the same time, the "Like" buttons on every other post worked just fine! I tested this, and then came back to the one post I couldn't "Like". Same behavior: flyout appears and disappears, no "Like" happens.
I used Chrome's developer tools to see what HTTP requests were being made, comparing the request/response for a working "like" to the "like" that wasn't working. The "Like" button JavaScript makes an HTTP POST request to http://www.facebook.com/plugins/like/connect and gets some JavaScript back. As best I could tell, the HTTP POST request was identical between the working and non-working like buttons, but the response was different. Below is the JavaScript response for a working like, followed by the JavaScript response for a like that wasn’t working:
for (;;);{"__ar":1,"payload":null,"jsmods":{"require":[["Plugin","connect",[],["http:\/\/www.hslda.org\/cms\/?q=blog\u00252Fpeeking-through-fence","10151028997762924"]]]}}
for (;;);{"__ar":1,"payload":null,"jsmods":{"require":[["Plugin","disconnect",[],["http:\/\/www.hslda.org\/cms\/?q=blog\u00252Fpoem-just-you"]]]}}
I note two distinctions: the working version “connect” whereas the non-working version has “disconnect”, and the working version has an additional parameter that looks like an ID. I’m guessing it’s the ID of this particular “like” event.
I did some Googling and couldn’t find a definitive answer. Trying to debug this, I used the Facebook Object Debugger. It found some “Like Button Warnings” and “Open Graph Warnings” that are worth fixing, but I don’t think they are the problem—because they were the same for URLs with working like buttons and for the URL with the like button that wasn’t working.
So then I decided to go to the Facebook Social Plugin page for the Like Button. I dropped in the URL of the non-likeable blog post, and tried liking it. It worked. I wondered, “is the like button on the page still broken?” I couldn’t like it because I’d already liked it. So I asked a coworker try and like the post, and it worked for him. I then had my coworker unlike the post, I unliked it (so we were back to no likes), and then I tried liking it again, using the like button on the blog post. It worked.
So, it seems like once I "forced" the page to be scraped again, it started working. But it's also possible that "forcing" a like through the Like button page broke something loose as well... not sure.
精彩评论