[thelist] Ampersands in URLs
aardvark
thelist at lists.evolt.org
Sat Oct 12 13:56:11 2002
> From: "Clive R Sweeney" <clive@designshift.com>
>
> A few of my pages have hyperlinks with URLs containing ampersands.
> This yields an "unknown entity" error in the W3C Validator. It's not a
> big deal, but just to tidy up, is there an easy way to escape the
> ampersand?
<a href="http://foo.bar/foo.asp?foo=bar&bar=foo">feh</a>
just convert '&' to '&'...
if you're pulling links in dynamically, use your server-side language
to encode the string -- in ASP, you could use server.HTMLEncode()...
most languages have a provision for handling this...
--
Read the evolt.org case study
Usability: The Site Speaks for Itself
http://amazon.com/exec/obidos/ASIN/1904151035/evoltorg02-20
ISBN: 1904151035