From c7f52f2f8a56a65a3b8a97953025bd98c28798de Mon Sep 17 00:00:00 2001 From: klochner Date: Tue, 17 Aug 2010 14:35:51 -0700 Subject: [PATCH] - 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 --- lib/facebooker2/rails/helpers/javascript.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/facebooker2/rails/helpers/javascript.rb b/lib/facebooker2/rails/helpers/javascript.rb index 16c9a91..8caaeaa 100644 --- a/lib/facebooker2/rails/helpers/javascript.rb +++ b/lib/facebooker2/rails/helpers/javascript.rb @@ -23,7 +23,7 @@ module Facebooker2 (function() { var s = document.createElement('div'); s.setAttribute('id','fb-root'); - document.documentElement.getElementsByTagName("HEAD")[0].appendChild(s); + document.documentElement.getElementsByTagName("body")[0].appendChild(s); var e = document.createElement('script'); e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; e.async = true; @@ -36,4 +36,4 @@ module Facebooker2 end end end -end \ No newline at end of file +end