More and more I feel like my posts are just giving simple but nonobvious workarounds to silly problems.
Today's topic is facebook LIKE. I encountered a problem recently where I was trying to provide a URL for a like button, but when I clicked on the button, it would show the little count bubble for a second and then revert back to the un-liked state. In my case I was using the FBXML version of the like button.
So it turns out that (<- I swear every one of my posts now has that line) this happens when you provide an invalid URL. I had tried urlencoding the URL, but apparently that doesn't help. So far I've found that the following characters do not work:
Do not work:
- URLs with GET parameters (ex: http://yoursite.com/?foo=bar)
- Fix: Use htaccess/mod_rewrite so you don't need GET-style URLs
- URLs with underscores (ex: http://yoursite.com/foo_bar)
- Fix: Use hyphens instead (ex: http://yoursite.com/foo-bar)