Sunday, October 31, 2010

fb_xd_fragment Bug Workaround

This post isn't meant for collectors on Colnect but is rather a technical post regarding Facebook integrations with a website.

Facebook "Like" button gets broken on IE when using the new Facebook API?
Your server gets weird requests with fb_xd_fragment in the URL?

This is a Facebook bug with the following quick solution:

1/ Change your FB.init to the following

FB.init({appId: appId, status: true, cookie: true, xfbml: true, channelUrl: 'http://example.com/channel.html'});
// ^ channel URL above used to workaround fb_xd_fragment bug


2/ Create the static file for http://example.com/channel.html with the following content:
<script src="http://connect.facebook.net/en_US/all.js"></script>


IMPORTANT NOTE: ensure channel.html has proper expiry headers sent, otherwise it might slow down user experience and overload your server.

6 comments:

  1. dont know why this not work on my case .. test on IE7 and 8
    other browser or other version work
    curent i had to swich to iframe likeit version
    but lossing people share the link to the fb

    any other fix ..
    thinking ab: use java script detect IE then write the iframe version other will be normal
    i dont know about script so anyone help ?
    thannks

    ReplyDelete
  2. I don't even have the FB.Init you mention because I'm just inserting the like box and like button. What should I do in this case?

    ReplyDelete
  3. Am I to assume that you remove the original line of code where you included the FB connect script before? Could u please detail how to do the expiry headers thing as well? Thanks

    ReplyDelete
  4. How does channel Url method work? Does it prevent the browser from creating a duplicate copy of the page or does it handles the duplicate requests?

    ReplyDelete
  5. More details how to do this for us non developers would be great!

    ReplyDelete
  6. The above instructions are a fix for developers. If you are trying to access a website that has the problem, your solution is using a different browser, other than IE.

    Or I suppose you could play the good samaritan and email this article to the site's web developers.

    ReplyDelete

We welcome comments to our blog post but MANUALLY verify each comment. Spam comments will be reported. When asking for an answer on anything Colnect related, please use Colnect's forums. Thanks and happy Colnecting :)

Link and Search

Did you like reading it? Stay in the loop via RSS. Thanks :)