Php FBML未在iframe中的Facebook应用程序中呈现-请帮助
我正在用PHP开发一个Facebook应用程序。它作为iframe而不是FBML加载。与Facebook的正常互动是有效的。例如,以下代码提供用户名:Php FBML未在iframe中的Facebook应用程序中呈现-请帮助,php,facebook,fbml,facebook-fbml,serverfbml,Php,Facebook,Fbml,Facebook Fbml,Serverfbml,我正在用PHP开发一个Facebook应用程序。它作为iframe而不是FBML加载。与Facebook的正常互动是有效的。例如,以下代码提供用户名: $facebook = new Facebook($config->appapikey, $config->appsecret); $user_id = $facebook->require_login($required_permissions = 'email'); echo $user->name; 其中$user
$facebook = new Facebook($config->appapikey, $config->appsecret);
$user_id = $facebook->require_login($required_permissions = 'email');
echo $user->name;
其中$user是从facebook加载用户详细信息的我的类。
我的文档以以下方式开始:
<!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">
<head><title>Appname</title>
</head>
<body>
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/de_DE" type="text/javascript"></script>
Appname
结局是这样的:
<script type="text/javascript">
FB_RequireFeatures(['XFBML','CanvasUtil'], function(){
FB.init("<?php echo $config->appapikey; ?>", "/app/xd_receiver.htm");
FB.CanvasClient.startTimerToSizeToContent();
});
</script>
</body>
</html>
FB_RequireFeatures(['XFBML','CanvasUtil',function(){
FB.init(“,”/app/xd_receiver.htm”);
FB.CanvasClient.startTimerToSizeToContent();
});
此外,正如我在Firebug中看到的那样,加载了xd_receiver.htm文件
但我的问题是,例如,请求表单没有加载。我的代码:
<fb:serverFbml>
<script type="text/fbml">
<fb:fbml>
<fb:request-form method="post" action="<?php echo $config->site; ?>index.php" type="appname" invite="true" target="_top" content="content">
<fb:multi-friend-selector actiontext="text" rows="3" showborder="true" target="_top"/>
</fb:request-form>
</fb:fbml>
</script>
</fb:serverFbml>
哇,我不知道该说什么。我刚刚检查了你所有的代码,看起来一切都准备就绪。也许试着加上这个
FB.XFBML.Host.autoParseDomTree = true;
在调用FB.init()
之后立即感谢您的回答,但您的代码没有任何更改。在我的应用程序的另一个地方,我试图向用户显示一个表单,以便在其墙上发布。这在过去也发挥了作用,但现在已不复存在。我的代码:函数publish(){var action_links=[{'text':'appame','href':'link'}];var message='message';FB_RequireFeatures([“Connect”],function(){FB.init('appid','xd_receiver.htm');FB.ensureInit(function(){FB.Connect.streamPublish(message,null,action_links,null);})}window.onload=发布;
FB.XFBML.Host.autoParseDomTree = true;