views:

336

answers:

1

Hi all,

I am building a simple facebook iframe application. I've decided since the code is separate from facebook none the less, I will also create a connect website as well. In my connect website I'm trying to figure out the following:

I am using facebook's new api and I am calling the init function. I can't seem to figure out where I combine my cross-domain file. There's no mention of it in their documentation either. http://developers.facebook.com/docs/reference/javascript/FB.init

I am referring to these lines of code:

<div id="fb-root"></div>
<script>
  window.fbAsyncInit = function() {
    FB.init({appId: 'your app id', status: true, cookie: true,
             xfbml: true});
  };
  (function() {
    var e = document.createElement('script'); e.async = true;
    e.src = document.location.protocol +
      '//connect.facebook.net/en_US/all.js';
    document.getElementById('fb-root').appendChild(e);
  }());
</script>
+1  A: 

My understanding is that you don't need a cross-domain receiver file with the new JS SDK. The FB.init function calls FB.XD.init(options.channelUrl);

You can see this function here: http://github.com/facebook/connect-js/blob/master/src/core/xd.js

All the cross-domain stuff is handled here, in some cases by placing an iFrame inside the fb-root div.

Nathan