URL参数未通过HTML5验证

时间:2013-07-12 00:53:31

标签: html html5 html-validation

这是网站: http://prodontic.com/cs2/index.php?q=conscience-statements&record=8

以下是W3C验证报告: http://validator.w3.org/check?uri=http%3A%2F%2Fprodontic.com%2Fcs2%2Findex.php%3Fq%3Dconscience-statements%26record%3D8&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.3+http%3A%2F%2Fvalidator.w3.org%2Fservices

这不会验证,但验证程序不会提供有关如何使用参数构建URL的任何指示。

这必须简单,但我似乎无法弄明白......我缺少什么?

提前感谢。

2 个答案:

答案 0 :(得分:3)

只需使用&替换HTML中的&

例如,替换

<a href='index.php?q=conscience-statements&record=7'>&laquo;</a>

<a href='index.php?q=conscience-statements&amp;record=7'>&laquo;</a>

答案 1 :(得分:1)

你说:but the validator does not give any indication about how to build URLs with parameters

这很奇怪,W3C的错误描述(反复)明确指出:
& probably should have been escaped as &amp;

另外,请看一下关于SO的答案:https://stackoverflow.com/a/3493425/588079

希望有所帮助!