【发布时间】:2009-06-08 16:14:58
【问题描述】:
我正在尝试创建一个 facebook 应用程序并浏览了 http://pragprog.com/titles/mmfacer/developing-facebook-platform-applications-with-rails 这本书。当我将画布渲染方法设置为 fbml 时,在我的开发机器上一切正常。但是,出于各种原因,我想用 iframe 构建一个应用程序。当我将我的应用程序设置为使用 iframe 时,我无法连接到我的开发机器。我浏览了很多关于创建 iframe 应用程序的不同文章,但似乎都没有。这包括
http://wiki.developers.facebook.com/index.php/Cross_Domain_Communication_Channel
http://wiki.developers.facebook.com/index.php/XFBML
以及任何其他网站在谷歌上搜索到 facebook、iframe、rails 和其他的任何组合。
我的公共目录中有 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>
我的问题是,当我将画布渲染方法设置为 iframe 时,我错过了什么阻止 facebook 连接到我的 Rails 开发机器?由于我的开发日志没有显示任何连接尝试,我猜测它与跨域的东西有关,但我无法在任何地方找到一个好的答案。
【问题讨论】:
标签: ruby-on-rails ruby facebook iframe