简体   繁体   English

FBML未在iframe的Facebook应用中呈现-请帮助

[英]FBML is not rendered in Facebook App in iframe - please help

I'm developing an Facebook Application in PHP. 我正在用PHP开发Facebook应用程序。 It's loaded as an iframe and not as FBML. 它作为iframe而不是FBML加载。 The normal interaction with Facebook works. 与Facebook的正常交互有效。 For example the following code gives the username: 例如,以下代码提供了用户名:

$facebook = new Facebook($config->appapikey, $config->appsecret);
$user_id = $facebook->require_login($required_permissions = 'email');
echo $user->name;

Where $user is my class in which the user-details are loaded from facebook. 其中$ user是我的类,其中从Facebook加载用户详细信息。 My document begins the following way: 我的文档以以下方式开始:

<!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>

And ends likes this: 结束像这样:

<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>

Also the file xd_receiver.htm is loaded as I can see in Firebug. 正如我在Firebug中看到的那样,文件xd_receiver.htm也已加载。

But my problem is that for example the request-form is not loaded. 但是我的问题是,例如,请求表单未加载。 My code: 我的代码:

<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>

I can see the code with Firebug but the form ist not displayed by Facebook. 我可以使用Firebug查看代码,但Facebook不会显示该表格ist。

2 or 3 weeks ago it was displayed but in this time I had the tags 2或3周前,它已显示,但是这次我有标签

    </fb:fbml>
</script>
</fb:serverFbml>

arround my complete text in the body. 把我的全文放在身体里。 2 weeks ago I had the the problem that nothing any more was displayed. 2周前,我遇到了一个问题,即不再显示任何内容。 After I removed the tags my app is displayed but not the form. 删除标签后,将显示我的应用程序,但不显示表单。

I am searchign the web vor 1 week now and read many Threads about FBML and XFBML in Facebook but nothing worked for me. 我现在一周前在网上搜索,阅读了很多关于Facebook上FBML和XFBML的主题,但对我没有任何帮助。

So thank you in advance for help. 因此,在此先感谢您的帮助。

Wow, I'm not sure what to say. 哇,我不确定该说些什么。 I just looked over all your code and everything looks to be in place. 我只是查看了所有代码,一切似乎都准备就绪。 Maybe try adding this 也许尝试添加这个

FB.XFBML.Host.autoParseDomTree = true;

Right after the call to FB.init() 在调用FB.init()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM