gpt4 book ai didi

HTML5 验证错误 a href (NFC)

转载 作者:可可西里 更新时间:2023-11-01 13:13:43 26 4
gpt4 key购买 nike

我屏蔽了以下 URL 中的所有特殊字符,但 w3c-validator 仍然抛出错误。我检查了所有 NFC 教程,但我不知道错误在哪里。有什么想法吗?

网址

<a href="http://www.example.de/index.php&#63;cnid&#61;efcb9a458fb823ba877ef53b7162598f&#38;ldtype&#61;grid&#38;cl&#61;alist&#38;tpl&#61;&#38;fnc&#61;executefilter&#38;fname&#61;&#38;attrfilter&#91;3a5d1ca314a5205fa7b7b3baa5d2f94e&#93;&#91;2f143d22ce421269b5c7d01a160f6541&#93;&#61;2f143d22ce421269b5c7d01a160f6541">Asche</a>

w3c-错误

Line 618, Column 441: Bad value http://www.example.de/index.php?cnid=efcb9a458fb823ba877ef53b7162598f&ldtype=grid&cl=alist&tpl=&fnc=executefilter&fname=&attrfilter[3a5d1ca314a5205fa7b7b3baa5d2f94e][2f143d22ce421269b5c7d01a160f6541]=2f143d22ce421269b5c7d01a160f6541 for attribute href on element a: Illegal character in query component.

…21269b5c7d01a160f6541&#93;&#61;2f143d22ce421269b5c7d01a160f6541">Asche</a></li>

IRI 引用的语法

Any URL. For example: /hello, #canvas, or http://example.org/. Characters should be represented in NFC and spaces should be escaped as %20. 

最佳答案

字符 [] 需要在 URL 中进行 % 编码,如 %5B%5D,根据STD 66 (其中附录 A 包含语法摘要,表明括号是“gen-delims”字符,查询部分中不允许出现这些字符,但 %-encoded 除外)。

您应该发布一个 HTML 文档,因为这是验证器的工作内容。以下测试文档(用于验证)包含您提到的正确编码的 URL:

<!doctype html>
<meta charset=utf-8>
<title></title>
<a href=
"http://www.example.de/index.php?cnid=efcb9a458fb823ba877ef53b7162598f&amp;ldtype=grid&amp;cl=alist&amp;tpl=&amp;fnc=executefilter&amp;fname=&amp;attrfilter%5B3a5d1ca314a5205fa7b7b3baa5d2f94e%5D%5B2f143d22ce421269b5c7d01a160f6541%5D=2f143d22ce421269b5c7d01a160f6541">foo</a>

除此之外,URL 不起作用;它会导致“多项选择”响应,这很奇怪(当服务器正在进行一些内容协商但没有找到可接受的替代方案时应该发出这样的消息,并且应该提供替代方案列表;但这里更多或少了“未找到”的情况)。

关于HTML5 验证错误 a href (NFC),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14717230/

26 4 0
文章推荐: Windows 10 - 小娜编程
文章推荐: php - 使用一个输入字段上传多张图片
文章推荐: php - 按字符串对多维数组进行排序?
文章推荐: javascript - 如何将 Title 属性添加到动态填充的