尝试在iFrame facebook应用程序中检索用户名时出错

时间:2010-07-20 07:23:13

标签: facebook facebook-iframe serverfbml

我正在使用iFrame渲染方法开发一个facebook应用程序。所以为了显示我的名字,我使用了serverfbml标签。这是我的代码:

 <fb:serverfbml style="width: 760px;"> 

     <script type="text/fbml"> 

     <fb:fbml> 

      <fb:name uid='$user_id' useyou='false'></fb:name>

      </fb:fbml>

     </script>

 </fb:serverfbml>

但输出是“Facebook用户”。 请解释一下为什么我会得到这种输出。

我对$ user_id进行了回显,并显示了id。

1 个答案:

答案 0 :(得分:1)

根据specification 显示的默认文本,如果您看不到该用户是 Facebook用户

您可以使用 ifcantsee 属性指定要显示的其他文字,如下所示:

<fb:name uid='$user_id' useyou='false' ifcantsee='Can not see this user'></fb:name>

specification 说:

  

如果是,则显示备用文本   登录用户无法访问用户   指定。指定空字符串   而不是默认值,使用   ifcantsee = “”。默认值是   Facebook用户