Forum Moderators: open

Message Too Old, No Replies

A litle Validation help please

Page not validating because of ampersands in link

         

jaeden

12:58 pm on Aug 30, 2002 (gmt 0)

10+ Year Member



I've never heard of this before I tried to validate my page using the w3c validator. I have a link with an ampersand in it that is not validating. Upon looking at the FAQ page, it says it is because it has an ampersand in the link.

....CategoryDisplay?cgrfnbr=8699&cgmenbr=26

It says I should change it to this...

....CategoryDisplay?cgrfnbr=8699&cgmenbr=26

I've never seen an & sign in a URL before. Is this something that is normally done for those of you that wish to have a validated site?

ukgimp

1:04 pm on Aug 30, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How bazaar, i have encountered that exact problem just 1 hour ago. I am also being hit by a URL=something parameter in querystring.

Any suggested resources cover this?

jaeden

1:39 pm on Aug 30, 2002 (gmt 0)

10+ Year Member



This is what I found about how the ampersand sign is viewed in a link...

[htmlhelp.com ]

choster

1:45 pm on Aug 30, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could also try replacing the ampersands with %38.

andreasfriedrich

2:16 pm on Aug 30, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This seems to be a common mistake. But just as having a look at the written law and precedents will help any lawyer to know what´s the law, reading the W3 specs will help the html author:

Authors should use "&" (ASCII decimal 38) instead of "&" to avoid confusion with the beginning of a character reference (entity reference open delimiter). Authors should also use "&" in attribute values since character references are allowed within CDATA attribute values.

HTML 4.01 Specification - Character entity references [w3.org]

rewboss

7:37 pm on Aug 30, 2002 (gmt 0)

10+ Year Member



You could also try replacing the ampersands with %38

Wouldn't that have the effect of escaping the ampersand -- meaning it would be interpreted as part of the data encoded in the URL instead of a marker to separate variables, as it is intended here?