Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE8 Win7 Facebook Connect Problem

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&fname=_opener&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">
<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.

like image 531
Brandon Watson Avatar asked Apr 03 '09 16:04

Brandon Watson


2 Answers

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">

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);
});
like image 88
Darren Newton Avatar answered Sep 24 '22 19:09

Darren Newton


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">

Does the trick! Thanks Darren.

like image 1
Kevin Crump Avatar answered Sep 24 '22 19:09

Kevin Crump