5

On my site I've implemented Facebook login button and it works well on all browsers except IE. Not sure why on IE it doesn't work well. You can see it broken on the main page of my website http://colnect.com with the following Javascript error:

Message: Unknown runtime error
Line: 43
Char: 729
Code: 0
URI: http://connect.facebook.net/en_US/all.js

On two other pages with the exact same FBML code http://colnect.com/en/account/create and http://colnect.com/en/sfGuardAuth/signin the button appears and works well.

Any ideas?

Collector
  • 2,034
  • 4
  • 22
  • 39

3 Answers3

15

Add this to your document:

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
sakibmoon
  • 2,026
  • 3
  • 22
  • 32
Danny
  • 986
  • 1
  • 18
  • 42
4

I had same problem because I put "fb:login-button" inside an "a" tag. If you have the fb button inside another element, try to leave it.

Raúl Leal
  • 41
  • 2
  • How is this different in the two pages I've sent? It's not inside an "a" tag and it's inside other elements because everything is always inside other elements. Thanks. – Collector Dec 20 '10 at 08:07
  • When I opened http://colnect.com my browser redirected me to http://colnect.com/ca and all was working fine in IE. I've tried to open http://colnect.com/en but don't render the button because the page doesn't have the 'div' with id='fb-root' – Raúl Leal Dec 21 '10 at 12:34
  • 1
    you just saved me hours of hunt and peck debugging. That fixed it! Thanks a lot. – Jhourlad Estrella Mar 16 '11 at 10:24
2

I just saw the same thing < curse_m$_ie tag > and was able to fix it by properly hooking up a channel file. From https://developers.facebook.com/docs/reference/javascript/:

Channel File

The channel file addresses some issues with cross domain communication in certain browsers. The contents of the channel.html file can be just a single line:

<script src="//connect.facebook.net/en_US/all.js"></script>

Ok, so I think they meant to add a http: at the front of that, anyway, that's what it took for me to get it working. Then you need to reference the channel file in your FB.init - well, see their page for this but it's generally:

<script>   
window.fbAsyncInit = function() {
FB.init({
appId      : 'YOUR_APP_ID', // App ID
channelUrl : '//WWW.YOUR_DOMAIN.COM/channel.html', // Channel File
...

Hope this is helpful to whoever is pulling their hair out on this right now. And hope it works for others besides me!

Oh, also just found this link on the subject: http://blog.tiecliphq.com/2011/06/ie8-facebook-xd-proxy-fix.html

sakibmoon
  • 2,026
  • 3
  • 22
  • 32
Eskim0
  • 775
  • 7
  • 17
  • 1
    They would have left the http off deliberately - // allows it to work over both http and https. – benz001 Feb 07 '12 at 07:02
  • good call. missed that - though I believe FB examples had http in there, plus they may now require https for all connections. not sure. – Eskim0 Oct 01 '13 at 05:08