質問

以下のコード:

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

<body>
    <a href="#" onclick="FB.Connect.inviteConnectUsers();">Test</a>
    <fb:serverfbml style="width: 350px;">  
        <script type="text/fbml">
            <fb:connect-form action="http://127.0.0.1/post_invite">     
            </fb:connect-form>
        </script>
    </fb:serverfbml>
</body>
</html>

次のエラーの結果:

   - Warning: Compilation failed
   - Warning: <class 'zope.tal.htmltalparser.NestingError'>: Open tags <html>, <body>, <fb:serverfbml>, <script> do not match close tag </fb:connect-form>, at line 16, column 4
PTRuntimeError: ['Compilation failed', u"<class 'zope.tal.htmltalparser.NestingError'>: Open tags <html>, <body>, <fb:serverfbml>, <script> do not match close tag </fb:connect-form>, at line 16, column 4"]

まだ構造は私にとって有効だと思われます...

役に立ちましたか?

解決

タグを<script>タグ内に配置することはできません。厳密なZPTパーサーがそれについて文句を言っています。 tal:content = <!> quot; structure string:<!> quot;のように、何らかの方法でコンテンツをエスケープする必要があります。構成:

<script type="text/fbml" tal:content="structure string:
    &lt;fb:connect-form action=&quot;http://127.0.0.1/post_invite&quot;&lt;         
    &gt;/fb:connect-form&lt;
"></script>

他のヒント

scriptタグには、私の知る限りxmlを含めないでください。

xmlコメントで内容を囲み、それが機能するかどうかを確認できます。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top