[thelist] mailto links & Outlook subjects
Andrew Clover
and-evolt at doxdesk.com
Fri Dec 17 18:18:18 CST 2004
<peter at easylistbox.com> wrote:
> You don't have to encode your ampersands in the querystring.
Not so. All HTML attributes, whether they contain URLs or anything else,
*must* escape ampersands (and less-than, and whichever quote character
is in use). href="foo?a=b&c=d" is invalid HTML and non-well-formed XML.
It will work in the average browser, until one of your parameters has
the same name as an HTML entity (eg. ?page=1§=3) at which point
it'll all go skewiff.
> In fact, if you do, you'll probably get some unwanted characters in
> your subject line.
No current browser has failed to unescape the ampersands in URLs for,
oh, a decade. Tim's code is correct.
Now, whether mailto: links with query strings are to be recommended is
another story...!
--
Andrew Clover
mailto:and at doxdesk.com
http://www.doxdesk.com/
More information about the thelist
mailing list