Facebook SDK script support
Created: Last updated:
Initially I thought I will wait with SDK support for Facebook but when I discovered that I was affected by a little glitch in the current JavaScript from Facebook I had to include the SDK support.
"Like" button problem
It is a little unclear when exactly the problem occurs but mainly when some users with older browsers and especially with IE (Internet Explorer) come along and press the "Like" button.
I guess it also happens with the app_id and some OPG (open graph protocol) stuff going on in the background. The whole information is a little bit hidden in this document
The problem is mainly about scrapping the content for the current webpage. When a user clicks the "Like" button a comment box is offered and some content from the current page included. Accordingly, Facebook makes a request to the current page.
This request may result in a log entry on the server side with a parameter fb_xd_fragment added to the link. I think this is probably not a direct problem for the user, i.e. seen by the user but Facebook, depending on the web application, cannot find any content for the comment box. My framework actually returns a 410 error page.
Solution
There are two things to prevent this problem. For one thing it requires a channel.html file on the server which apparently prevents this call.
Second the JavaScript needs to be the slightly different SDK script; however, I think this is only required for links to the app_id and not the regular page.
Anyway, both recommended things have been included. A request to channel.html will return the appropriate fill with the script and the JavaScript is the updated SDK version.