以下代码:
<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"]然而这种结构在我看来是有效的..。
发布于 2009-10-29 22:45:35
不能将标记放在<script>标记内,严格的ZPT解析器对此颇有微词。您必须以某种方式对内容进行转义,比如使用tal:content="structure string:“构造:
<script type="text/fbml" tal:content="structure string:
<fb:connect-form action="http://127.0.0.1/post_invite"<
>/fb:connect-form<
"></script>发布于 2009-10-29 22:00:57
据我所知,脚本标记不能包含xml。
您可以将内容包含在xml注释中,看看是否有效。
https://stackoverflow.com/questions/1643385
复制相似问题