Joomla 联系表单未通过 W3C 验证
当我尝试验证网站上的联系页面时,出现以下错误:
文档类型不允许此处使用元素“脚本”
在不允许的上下文中发现了上述元素。这可能意味着您有错误的嵌套元素 - 例如“body”部分中的“style”元素而不是“head”内的元素 - 或者两个重叠的元素(这是不允许的)。
导致此错误的一个常见原因是在 HTML 文档中使用了 XHTML 语法。由于 HTML 隐式关闭元素的规则,此错误可能会产生级联效应。例如,在 HTML 文档的“head”部分中使用 XHTML 的“meta”和“link”标签可能会导致解析器推断出“head”部分的结尾和“body”的开头。 ”部分(其中不允许“链接”和“元”;因此报告错误)。
我正在使用 Joomla 1.5.7,文档类型是
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
知道如何解决这个问题吗?
I get the following error when I try to validate a contact page on my site:
document type does not allow element "script" here
The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).
One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).
I am using Joomla 1.5.7, and the doctype is
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Any idea how to fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,您需要更新 Joomla 安装。 1.5.7 已经发布近 2 年了,已经修复了数十个已知的安全问题。当前版本是1.5.22,您可以在这里获取补丁包 - 1.5.7 到 1.5.22 补丁
接下来,最有可能解决验证问题的简单方法是使用 Beez 模板附带的联系页面的修改版本核心安装。如果您查看 joomla/templates/bees/html/ 您将看到一个名为 com_contact 的文件夹。将其复制到 joomla/templates/[your template]/html/ ,这很可能会解决问题。如果问题仍然存在,那么您需要找出确切的问题以及哪个模块/插件将代码添加到页面。
First, you need to update your Joomla install. 1.5.7 is nearly 2 years old and there are dozens of known security issues that have been patched. The current version is 1.5.22, you can get the patch package here - 1.5.7 to 1.5.22 patch
Next, the easy way to most likely fix your validation issue is to use the modified version of the contact page that comes with the Beez template in the core install. If you look in joomla/templates/bees/html/ you will see a folder called com_contact. Copy that to joomla/templates/[your template]/html/ and that will most likely fix the problem. If you still have the problem then you will need to track down the exact problem and what module/plugin is adding the code to the page.