2011-09-29 97 views
0

这种情况觉得不可思议。serverfbml一个页面上返回404,而不是克隆

我有一个FBML页面的两个版本,以显示用户邀请的名单。这两页返回相同的html。唯一的区别是,一个拥有像http://mydomain/user/myFriends一个URL和其他具有URL http://mydomain/facebook/myFriends

一个版本的伟大工程,当浏览器试图从Facebook获得serverfbml其他卡返回404。这是IE和Firefox的尝试。

什么是更奇怪的是,如果我使用firefox firebug调试器,并点击获取serverfbml的url并要求它加载到一个单独的选项卡中,我仍然会得到相同的确切行为。但我可以看看firefox为这两个页面加载的源代码,并且看到它是INDENTICAL。

这里是页面的HTML。

<!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" xml:lang="en" lang="en" dir="ltr"> 
<head> 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> 


    <link type="text/css" rel="stylesheet" href="/css/common.css"/> 

</head> 

<body id="page-facebook" class="facebook page-facebook-showInviteFriends logged-in "> 
<script type="text/javascript" src="/js/jquery-1.4.2.min.js"></script> 

<script type="text/javascript" src="/js/common.js"></script> 



<html xmlns:fb="http://www.facebook.com/2008/fbml"> 
<fb:serverFbml width="760" height="346" style="width: 760px; height: 346px;"> 
    <script type="text/fbml"> 
     <fb:fbml style="width: 324px; height: 346px;"> 
      <fb:request-form 
       action="" 
       method="POST" 
       invite="true" 
       type="Sample Name" 
       content="<fb:req-choice url='' label='Join Now!'></fb:req-choice> 
       "> 

       <fb:multi-friend-selector 
        condensed="true" 
        showborder="true" 
        actiontext="Invite your friends" 
        email_invite=false 
        import_external_friends=false 
        exclude_ids="" 
        unselected_rows="10" 
        selected_rows="3" 
       /> 
       <fb:request-form-submit import_external_friends="false" label="null" /> 
      </fb:request-form> 
     </fb:fbml> 
    </script> 
</fb:serverFbml> 
</html> 



<div id="fb-root"></div> 
<script> 
    window.fbAsyncInit = function() { 
    FB.init({ 
     appId : '130456257111111', 
     status : true, // check login status 
     cookie : true, // enable cookies to allow the server to access the session 
     xfbml : true, // parse XFBML 
     channelUrl : 'http://sample.foobar.com/static/html/channel.html' 
    }); 
    }; 

    (function(d){ 
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;} 
js = d.createElement('script'); js.id = id; js.async = true; 
js.src = "//connect.facebook.net/en_US/all.js"; 
d.getElementsByTagName('head')[0].appendChild(js); 
}(document)); 
</script> 
<script type="text/javascript" src="/js/facebook.js"></script> 
</body> 
</html> 

回答

0

我想通了这个问题。该应用程序注册了mydomain/facebook的画布页面。由于其他网页的网址不在/ facebook下,因此呼叫失败。这真是来自Facebook的糟糕错误消息。文档中没有任何明显的地方表明,要求所有获取的内容都必须在canvas模式下。

所以我通过改变我的官方画布网址为根路径并更改默认网址映射到我的应用程序的方式来修复它。