Rick Lecoat wrote:
> can anyone tell me what is the best accessible way (if any) of encoding
> a mailto: link? I want to make the email addresses on a site usable to
> screen reader users, but don't want them harvested by spambots.
>
> Javascripted solutions seem like they would create a headache for screen
> readers, and any plain text equivalent presented in the name of
> accessibility would simply be harvested instead. And I prefer to avoid
> jscript if I can anyway.
I too am interested to know what others are doing. Javascript seems the
best way because you can keep the code to generate and insert a mailto
external to the html file but you have to cover the problem where
javascript can't be used.
I have a function I wrote in PHP that converts a string of characters to
their ASCII values and this works ok but is still in the html code so
maybe harvesters look for the ASCII value of the @ symbol and find
addresses still?
function htmlEncode($str)
{
$encoded = "";
for ($i = 0; $i < strlen($str); $i++) {
$encoded .= "&#".ord($str[$i]).";";
}
return $encoded;
}
*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************