2010-07-12 68 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

我有同樣的問題。但在可能的情況下,包含的行動參數「(雙引號)。當我加斜線問題已經消失。