views:

2570

answers:

5

Update 4/8/09 - I'm into a new week with no progress and no answers from the Facebook forums. Not one response over there, which is pretty disappointing. I also cannot figure out how to put a bounty on this question, but I would really, really love to get this issue solved.


I have looked at many posts to see if this was posted before, and it was not. Here's the short version:

I am going through the sample FB Connect tutorial (v1) and cannot make it work in IE8 on Win7. It works as expected on FF3 on Win7.

Long Version:

I was suprised that things weren't working since I had pretty much copy and pasted over the content. I skipped over the bit with the alert() javascript call, so I put that in to see if the parser was even getting to that. I put the following code in:

[my raw html]
Or use, <fb:login-button length="long" onlogin="alert('yo!!!');"></fb:login-button>
[/my raw html]

The Alert is not popping on IE8. It works on FF.

When I change back to calling the update_user_box(), my HTML looks like:

Or use, <fb:login-button length="long" onlogin="update_user_box();"></fb:login-button>

<script type="text/javascript">
    function update_user_box() {
        var user_box = document.getElementById("user");
        user_box.innerHTML =
            "<span>"
            + "<fb:profile-pic uid='loggedinuser' facebook-logo='true'></fb:profile_pic>"
            + "Welcome, <fb:name uid='loggedinuser' useyou='false'></fb:name>."
            + "You are signed in."
            + "</span>"

        FB.XFBML.Host.parseDomTree();
    }

    FB.init("23e24c73feed7ca0f6afd876575842de", "../../Connect/xd_receiver.htm", { "ifUserConnected": update_user_box });
</script>

Again, this works in FF3 just fine. My picture shows up and everything. It actually makes me more upset that it worked in FF3 than a complete no work situation.

Here is the witnessed behavior in IE8:

  1. When I click on the FBConnect button. the javascript window pops up and loads the right logon page

  2. Focus changes back to the main window (the one with my app)

  3. The main IE8 window (the one where I clicked the connect button) now shows a facebook logon page.

  4. When I input my credentials into the FB javascript window, the page loads a blank doc URL of that page: http://localhost:55994/Connect/xd_receiver.htm?fb_login&amp;fname=_opener&amp;session=%7B%22session_key%22%3A%223.A4DpHk4nrKHooB7K_Q6EiA__.86400.1238796000-623225%22%2C%22uid%22%3A%22623225%22%2C%22expires%22%3A1238796000%2C%22secret%22%3A%22HtjtJS_xg8dX7TR7lLggew__%22%2C%22sig%22%3A%22ae12c0f98d4567612b70861314d42fbb%22%7D

View Source of that 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" >
<body>
    <script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/XdCommReceiver.js" type="text/javascript"></script>
</body>
</html>

5, If I close that window and type my credentials into the app window, the page reloads with the FBConnect button.

As I said, I am getting the expected behavior in FF3, but not IE8. I even tried IE8's compatability mode, but that didn't work either. Anyone have any clues as to what is happening?

My HTML tag looks like:

So I know that's not the issue.

+2  A: 

I had the same issue - Make sure you have the HTML namespace setup on your main page:

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"&gt;

http://forum.developers.facebook.com/viewtopic.php?id=23412

Also, I did some bootstrapping to prevent a null error:

FB.Bootstrap.requireFeatures(["Connect"], function() 
{
    FB.init("--api-key--","domain/xd_receiver.htm");
    FB.Connect.ifUserConnected(your_function_here);
});
Darren Newton
A: 

I am stuck with the same issue. Did anyone figure this out?

Brian
A: 

IE8 and Facebook Connect Simple.

On my Facebook Connect Site I am developing the Facebook widgets simply did not load

Of course you must have Javascript enabled in IE8 (much other info on this ) which I made sure.

Still no go.

Then the post above by Darrent Newton....

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"&gt;

Does the trick! Thanks Darren.

Kevin Crump
A: 

Hello, I had some trouble getting facebook connect to work with the new Javascript SDK authentication methods - it worked fine in Chrome and FF but not IE8.0

After some tinkering around I discovered that

was needed.

I also had to edit my application settings: Change Connect URL to something like: http://XXX.YYY.org:8006/XXXX/ and change Base Domain to something like: YYY.org

Note: As I test on a local machine setting the base domain to an IP address did not work. Render method: iframe

Javascript for reference:

<script src="http://connect.facebook.net/en_US/all.js"&gt;&lt;/script&gt;

<script>

  FB.init({appId: '{{facebook_app_id}}', status: true, cookie: true, xfbml: true});
  FB.Event.subscribe('auth.sessionChange', function(response) {
    if (response.session) {
      // A user has logged in, and a new cookie has been saved
        window.location.reload();
    } else {
        // The user has logged out, and the cookie has been cleared
    }
  });

</script>
Eamonn Gahan
A: 

Does this work with HTML5? Should I leave out the first bit?

xmlns="http://www.w3.org/1999/xhtml"

My old header was

<html lang="en">

Should it be?

<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"&gt;

Would be great to get an answer :)

Edd Turtle