我正在使用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;,我无法将值传递到下一页。 有人请帮帮我。提前致谢
答案 0 :(得分:53)
您是否在&
之后加入了分号?你的链接应该是
<a href="index.php?option=com_content&view=article&id=6&Itemid=4">
请注意,如果您将此网址粘贴到浏览器的地址栏中,则无法使用 - 当您点击页面中的链接时,浏览器会将&
转换为&
。
答案 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">