“&没有开始一个字符引用。(&可能应该被转义为&amp ;.)”w3c标记

时间:2013-04-12 11:54:42

标签: html5 w3c-validation

我正在使用w3c标记验证器。我收到这个错误:

Line 169, Column 60: & did not start a character reference. (& probably should have been escaped as &.)
    <a href="index.php?option=com_content&view=article&id=6&Itemid=4">

如果我使用&amp; amp而不是&amp;,我无法将值传递到下一页。 有人请帮帮我。提前致谢

2 个答案:

答案 0 :(得分:53)

您是否在&amp之后加入了分号?你的链接应该是

<a href="index.php?option=com_content&amp;view=article&amp;id=6&amp;Itemid=4">

请注意,如果您将此网址粘贴到浏览器的地址栏中,则无法使用 - 当您点击页面中的链接时,浏览器会将&amp;转换为&

答案 1 :(得分:0)

The value of an href attribute should be url encoded, not html encoded:

<a href="index.php?option=com_content%26view=article%26id=6%26Itemid=4">