- the async call needs to load into the body, otherwise FB.ui doesn't work in "dialog" mode

- facebook also recommends loading into the front of the body:
  http://developers.facebook.com/docs/reference/javascript/FB.init
This commit is contained in:
klochner 2010-08-17 14:35:51 -07:00 committed by Reiner Dieterich
parent 9327bfe44c
commit 1a4f9daae2

View File

@ -40,7 +40,7 @@ module Facebooker2
(function() { (function() {
var s = document.createElement('div'); var s = document.createElement('div');
s.setAttribute('id','fb-root'); s.setAttribute('id','fb-root');
document.documentElement.getElementsByTagName("HEAD")[0].appendChild(s); document.documentElement.getElementsByTagName("body")[0].appendChild(s);
var e = document.createElement('script'); var e = document.createElement('script');
e.src = document.location.protocol + '//connect.facebook.net/#{locale}/all.js'; e.src = document.location.protocol + '//connect.facebook.net/#{locale}/all.js';
e.async = true; e.async = true;