views:

1066

answers:

6

Symptom: After connect popup window opens and user enters username + password. The popup turns blank and stays open.

There is no call to the login function (but a page refresh shows the cookies are set and user is actually logged in).

I debugged the code and found that the xdcommReceiver.js file is stuck in endless loop in the function dispatchMessage.

Further investigation shows that there is an exception happening in the line: func = hostWindow.FB.XdComm.Server.singleton.onReceiverLoaded;

The exception is "Permission denied for http://www.site.com to get property Window.FB from http://site.coml."

Can anyone suggest how to solve it?

additional info:

the site connect url is http://www.site.com/ the page it happens on is in the format : http://www.site/com/folder/folder2/

A: 

Try using xd_receiver file rather than making it available using script. Also make sure that your page is able to find xd_receiver file. To avoid any issues, you can specify full path to your xd_receiver file like so in your code:

www.yoursite.com/xd_receiver.htm

Sarfraz
A: 

This problem also happens when some javascript changes the domain. For example your page is in a.x.com. Then a script in the page does something like document.domain = "x.com";

your domain is changed and this problem shows up.

Aykut
A: 

The solution was to add document.domain=site.com into xd_received.htm file (it is hidden somewhere in FB wiki documentation)

Nir
A: 

Thank you so much! Couldnt the wiki get reorganized...?

Pitt
A: 

hi Ahmed, I posted this : http://forum.developers.facebook.com/viewtopic.php?pid=201495 some days ago, and this modification is the only method I found to make it work. By keeping the original xd_receiver.htm file, even by specifying full path, I just cant publish my website. If you see how I could configure anything (look at my post please) to make it work without modification, please tell me!

Pitt
A: 

Hi folks,

for those who have loop problem and uses the sample-code from Facebook API developer pages, I have a tip:

I had the same problem. What I did wrong was that when I modified script to my needs, I accidently replaced cookie with _cookie - this changed the variable "cookie: true" and made the infinite loop.

FB.init({appId: '', status: true, _cookie: true, xfbml: true});

The line should say:

FB.init({appId: '', status: true, cookie: true, xfbml: true});

Hope this helps some..


We're on the march - the empire is on the run. Check out Alex Jones message on http://www.infowars.com

Per

related questions