views:

588

answers:

4

I've boiled down my page to the simplest possible thing, and it still doesn't work in IE8.

Here's the entire html page:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xml:lang="en" lang="en">
<head></head>
<body>
<div id="fb-root"></div>
<fb:login-button></fb:login-button>
<script src="http://connect.facebook.net/en_US/all.js"&gt;&lt;/script&gt;
<script>
  FB.init({appId: 'd663755ef4dd07c246e047ea97b44d6a', status: true, cookie: true, xfbml: true});
  FB.Event.subscribe('auth.sessionChange', function(response) {
    alert(JSON.stringify(response));
  });
  FB.getLoginStatus(function (response) { alert(JSON.stringify(response)); });
</script>
</body>
</html>

In firefox, safari, and chrome (on a mac), I get the behavior I expect: if I am not logged into Facebook, I get a dialog on page load with an empty session. When I click the Login button and log in, I get a second dialog with a session. If I am logged into Facebook, I get two dialogs with sessions: one from the getLoginStatus call, and another from the event.

In IE8, I get no dialogs when I load the page. The getLoginStatus callback is not invoked. When I click the Login button, I get a dialog, but it has a very strange error in it:

Invalid Argument

The Facebook Connect cross-domain receiver URL (http://static.ak.fbcdn.net/connect/xd_proxy.php#?=&amp;cb=f3e91da434653f2&amp;origin=http%3A%2F%2Fmysiteurl.com%2Ff210cba91f2a6d4&amp;relation=opener&amp;transport=flash&amp;frame=f27aa957225164&amp;result=xxRESULTTOKENxx) must have the application's Connect URL (http://mysiteurl.com/) as a prefix. You can configure the Connect URL in the Application Settings Editor.

I've sanitized the Connect URL above, but it is correct.

The dialog does have username/password fields. If I log in, the dialog box gets redirected to my Connect URL, but there's no fb cookie, so of course nothing works.

What am I doing wrong here?

Update (2010 Sep 10):

This problem is not universal. My site url has a port number in it, because it's my test site: http://mysiteurl.com:12345. Without a port number, ie8 seems to be ok. With the port number, it continues to fail as it did before. However, the error message is now more terse:

Invalid Argument

Given URL is not allowed by the Application configuration

Also, this problem is specific to IE (actually, I suspect it's specific to the flash XD transport, but I don't know how to confirm that). It works fine on every other platform/browser pair I've tried.

I am still no closer to making this work with a url with a port number.

A: 

having the same problem. works in all browsers except ie 7 and 8.

colin
"me too" isn't an answer to the question.
Josh Smeaton
A: 

Having the same issue here. Anybody has a fix for this? The facebook official documentation (and Forums!) have proven really unhelpful =(

edgarjcfn
"me too" isn't an answer to the question.
Josh Smeaton
A: 

They REALLY should publish this. But when working on you local server on a random port e.g 8080 you HAVE to use 127.0.0.1 and NOT localhost or else it won't work in IE. ALso ensure that your connect URL in the facebook application's settings is set to 127.0.0.1

Hans
This isn't an answer to the question, or even a "me too". It's an entirely different issue. I'm using a real port on a real host.
archbishop
I struggled with this all day. Based on this post, I published my sample site to a sample domain name (not localhost or 127.0.0.1) and it worked in IE8. That was really frustrating. Looking forward to checking the Fiddler logs tomorrow morning. Uhg.
AndrewDotHay
A: 

I have been fiddling with my code for hours trying to figure this out. My situation is a bit different, but I feel it may be from the same problem:

Anytime I would execute commands under the FB.Event.Subscribe function, IE8 would execute my entire command before the trigger event had actually changed (e.g., when subscribed to 'auth.login', the cb function would execute before a user typed his/her username and password). Of course, my callback functions depended on data necessary after the user had logged in.

I test in IE, Firefox, and Chrome, and IE is the only browser giving me trouble. I, too, have my test site running under a port other than 80, but I haven't tried specific diagnostics yet to pinpoint the problem, although I'm fairly certain it relates to this.

Hopefully this helps anyone with similar issues at least be aware of other possible problems. Hope to find an answer or workaround soon!

Brett