facebook connect javascript error in IE8
I'm using the Facebook C# SDK.
I opened the hello world sample, it runs fine in chrome and firefox, but doesn't seem to work in IE8.
I'm getting this error:
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Cent开发者_运维知识库er PC 6.0; .NET4.0C; .NET4.0E) Timestamp: Wed, 22 Dec 2010 23:00:00 UTC
Message: 'FB.XD.resolveRelation(...).FB' is null or not an object Line: 16 Char: 2193 Code: 0 URI: http://connect.facebook.net/en_US/all.js
Any Ideas what is wrong?
Most likely you are running on a port other than 80 and running it locally. There are some bugs in Facebook's Javascript SDK that will cause sites running on non-standard ports to fail. Try running the sample on port 80 and it should work in IE.
What you are seeing is one of the common challenges of facebook development. Some things are a little tricky to get working in a testing environment. I generally, just test everything in chrome locally and then test in IE when i deploy to staging. A bit of a pain, but such is how it goes when building a Facebook App.
Got it. It didn't have anything to do with IE 8 minor version changes after all. It happens if you have de javascript debug option enabled. Oddly, if you turn it off, IE won't even complain or display an error on the status bar left corner. Luckily, the majority of your IE8 users will be regular users who don't use this kind of option. We deployed code in production this way. Anyway, I found a lot of other IE related bugs when using Facebook API. Even had to do some hacks to prevent some of them. This is one I couldn't get rid off. Guess you will have to live with it. But, guess what, today Microsoft announced that it will upgrade automatically Internet Explorer, starting January:
http://www.geek.com/articles/geek-pick/microsoft-decides-to-automatically-update-internet-explorer-for-everyone-20111215/
This will definitely reduce our (web developers) amount of headaches :-)
精彩评论