2010-07-12 66 views
1

我在Facebook开发者论坛中询问the same question,但由于某些原因,我想在此重新发布。我希望没关系。fb:serverfbml不会在Opera和IE上显示

我有以下fb:serverfbml snippet。

<fb:serverfbml id="invite_friends_form" style="width: 100%"> 
    <script type="text/fbml"> 
    <fb:fbml><p>Testing FBML rendering</p></fb:fbml> 
    </script> 
</fb:serverfbml> 

<script> 
    $(document).ready(function() 
    { 
     // Parse XFBML tags 
     FB.XFBML.parse(); 
    }); 
</script> 

它在Firefox和Chrome中正确渲染。我有一段时间收到了通常的Facebook加载动画,然后显示“Testing FBML rendering”这个句子。

但是,当我在Opera 10和Internet Explorer 8上测试它时,它不起作用。我确实看到Facebook加载动画,但它从未完成。当我看到我的网络监视器时,我看到了一个http://www.facebook.com/plugins/serverfbml.php的请求,在查询字符串中传递了要呈现的FBML。

该请求已经完成,来自facebook的正确响应,但仍然是加载动画继续。

有谁知道,这里可能是什么问题?

谢谢,Andree。

+0

任何方式我可以自己测试这个,而不必写入我自己的fB应用程序? – hallvors 2010-07-19 13:36:35

+0

恐怕不是。但是在公共服务器上托管应用程序。目前,我正在测试整个东西在本地。嘿,这可能是问题吗? – Andree 2010-07-19 13:48:19

+0

同样在这里,FB.Event.subscribe回调现在工作在IE8 – Herr 2010-11-08 22:11:09

回答

1

我整个上午都有同样的问题,终于解决了! :)

地址:

<div id="fb-root"></div> 

...你的身体里面的一些地方。

此外,添加的xmlns:FB = “http://www.facebook.com/2008/fbml” 以HTML标记,以便它的内容:

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"> 

我要去发布我的整个代码,以便您可以比较:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"> 
<head> 
    <title></title> 
</head> 


<body style="margin:0px 0px 0px 0px;overflow:hidden;text-align:center;"> 

    <div id="fb-root"></div> 

    <fb:serverFbml> 
     <script type="text/fbml"> 
      <fb:fbml> 
       <fb:request-form 
        method="POST" 
        type="jugar a Mahou Liga Chapas" 
        action="http://mahouligachapas.unusualwonder.com" 
        content='¿ Te echas un partido conmigo? 
         <fb:req-choice url="http://apps.facebook.com/mahouligachapas" label="Sí" /> 
         <fb:req-choice url="http://www.facebook.com" label="No" />' 
       > 
        <fb:multi-friend-selector actiontext="Invita a tus amigos a jugar a Mahou Liga Chapas"/> 
       </fb:request-form> 
      </fb:fbml> 
     </script> 
    </fb:serverFbml> 

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script> 
    <script type="text/javascript" src="http://connect.facebook.net/es_ES/all.js"></script> 

    <script type="text/javascript"> 
     $(document).ready(function() { 
      FB.init({ appId: 'XXXXXXXXXXX', status: true, cookie: true, xfbml: true }); 
     }); 

    </script> 

</body> 
</html> 
+0

谢谢!这完全工作。一直试图解决这个问题超过半天。 – Alagu 2011-08-17 03:28:29

0

我有同样的问题。但在可能的情况下,包含的行动参数“(双引号)。当我加斜线问题已经消失。