0

このケースは信じられないようです。

招待するユーザーのリストを表示する 2 つのバージョンの fbml ページがあります。2 つのページは同一の html を返します。唯一の違いは、一方にはhttp://mydomain/user/myFriendsのような URLがあり、もう一方にはhttp://mydomain/facebook/myFriendsのような URL があることです。

1 つのバージョンは問題なく動作しますが、ブラウザーが Facebook から serverfbml を取得しようとすると、もう 1 つのバージョンは 404 を返すことになります。これは IE と Firefox の両方で試してみてください。

さらに奇妙なのは、firefox firebug デバッガーを使用して serverfbml の get の 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>
4

1 に答える 1

0

私は問題を理解しました。アプリは mydomain/facebook のキャンバス ページに登録されます。他のページには /facebook の下にない URL があるため、呼び出しは失敗します。これは、Facebook からの非常に質の悪いエラー メッセージです。ドキュメントのどこにも、フェッチされたすべてのコンテンツがキャンバスの URL パターンの下にある必要があることが要件であることは明らかではありません。

そこで、公式のキャンバス URL をルート パスに変更し、デフォルトの URL をアプリにマップする方法を変更して修正しました。

于 2011-09-29T19:57:21.220 に答える