Hi
Is a URL written in HTML like this invalid?
<a href="http://www.example.com/test.aspx?ID=34&amp;Type=5">link example</a>
or should the &
part always be &?
Hi
Is a URL written in HTML like this invalid?
<a href="http://www.example.com/test.aspx?ID=34&amp;Type=5">link example</a>
or should the &
part always be &?
Your HTML is valid. The "&" alone is assumed to begin an entity reference. Browsers often recover safely from this kind of error, but real problems do occur in some cases. In this example, many browsers correctly convert ©=3 to ©=3, which may cause the link to fail.
To avoid problems with both validators and browsers, always use &
in place of & when writing URLs in HTML
Please forgive the original edit, it appears i was mistaken. From the W3C linked below:
Single ampersands. Although HTML user agents have tended to turn a blind eye, you should never have a single ampersand (&) in your document. You should pay particular attention to URIs that include parameters. For example, your document should contain http://example.org/my-script.php?class=guest&amp;name=user, rather than http://example.org/my-script.php?class=guest&name=user.