我正在嘗試創建一個Facebook應用程序,並通過了本書http://pragprog.com/titles/mmfacer/developing-facebook-platform-applications-with-rails。當我的畫布渲染方法設置爲fbml時,在我的開發機器上一切正常。但是,由於各種原因,我想用iframe構建一個應用程序。當我將應用程序設置爲使用iframe時,我無法連接到我的開發計算機。我經歷了許多關於創建iframe應用程序的不同文章,但似乎沒有任何工作。這包括在軌道上的iframe的Facebook應用程序
http://wiki.developers.facebook.com/index.php/Cross_Domain_Communication_Channel
http://wiki.developers.facebook.com/index.php/XFBML
,發現谷歌搜索的臉譜,IFRAME,鐵路和其他任何組合的任何其他網站。
我有我的公開目錄中的文件xd_receiver.htm和我的佈局看起來像
<!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」 xmlns:fb=」http://www.facebook.com/2008/fbml」>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title><%= controller.controller_name %>: <%= controller.action_name %></title>
<%= stylesheet_link_tag "jquery-ui-1.7.1.custom.css", "styles" %>
<%= javascript_include_tag "jquery-1.3.2.min.js", "application" %>
</head>
<body>
<%= yield %>
<script src="http://static.ak.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>
<script type="text/javascript">
FB_RequireFeatures(["XFBML"], function(){
FB.Facebook.init("my api key", "xd_receiver.htm"); });
</script>
</body>
</html>
我的問題是,我錯過什麼是防止從Facebook的連接到我的Rails開發機的時候我設置畫布渲染方法到iframe?由於我的開發日誌沒有顯示任何連接嘗試,我猜測它與跨域的東西有關,但我無法在任何地方找到一個好的答案。
(我會發表評論,而不是一個答案,但我的成績並不讓我)。 – joshnesbitt 2009-06-13 22:26:42