如何在 achor 链接中编写 url,以免引发错误/警告 @ w3c 验证器

发布于 2025-01-03 04:04:51 字数 568 浏览 4 评论 0原文

只是一个带有参数的简单链接

<a href="http://domainame.com/?bla=ble&bli=blo">hey!</a>

就会使 w3c 验证器跳转两个错误,一个用于等于 (=),一个用于 and (&)

Error Line 1, Column 43: reference to entity "bli" for which no system identifier could be generated




This is usually a cascading error caused by a an undefined entity reference or use of an unencoded ampersand (&) in an URL or body text. See the previous message for further details.
Info Line 1, Column 39: entity was defined here

我如何编写它们并获得 0 个错误/警告?

just a simple link with parameters

<a href="http://domainame.com/?bla=ble&bli=blo">hey!</a>

would make the w3c validator jump two errors, one for the equeal (=) and one for the and (&)

Error Line 1, Column 43: reference to entity "bli" for which no system identifier could be generated




This is usually a cascading error caused by a an undefined entity reference or use of an unencoded ampersand (&) in an URL or body text. See the previous message for further details.
Info Line 1, Column 39: entity was defined here

How can i write them and get 0 errors/warnings?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

望喜 2025-01-10 04:04:51

等号不会引发错误。将 & 替换为 &,如下所示:

<a href="http://domainame.com/?bla=ble&bli=blo">hey!</a>

The equal sign throws no errors. Replace the & with & like so:

<a href="http://domainame.com/?bla=ble&bli=blo">hey!</a>
静赏你的温柔 2025-01-10 04:04:51

我认为你只需要转义字符

例如 = 将是 %3D& 将是 &< /code>

在此处了解更多信息HTML url 编码

i think you just need to escape the characters

For example = will be %3D and & will be &

Read more here HTML url encoding

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文