[thelist] Using JavaScript for non-clickable email addresses

Jono ox4dboy at comcast.net
Wed Jan 26 10:22:06 CST 2005


Thanks Rob.  I have ( for now ) gone with your approach.  It works  
quite nicely.  IE 6 renders it as plain text, and remains rendered as  
plain text ( no underline ) on mosuer over.  I added a class to your  
<span> tags to remove the underline, and change the text to matchthe  
oterh text color:

.nodecorate {
	text-decoration: none;
	color: #333;
	}

H T M  L
<a name="anchor1" onmouseup="hello(this)"><span  
class="nodecorate">name</span><span  
class="nodecorate">&#064;</span><span  
class="nodecorate">domain.com</span></a>

Now the address renders just like plain text.

This is good enough for now ( or better than nothing at least ) until a  
back-end solution is devised.

Thanks,

On Jan 25, 2005, at 8:41 PM, Robert Vreeland wrote:
> <script type="text/javascript">
> function hello(){
>  linkArray = "";
>  if(arguments[0].nodeName == ("A" || "a")){
>   linkArray = "mailto:";
>   linkArray = linkArray + arguments[0].firstChild.innerHTML;
>   linkArray = linkArray + "@";
>   linkArray = linkArray +
> arguments[0].firstChild.nextSibling.nextSibling.innerHTML;
>   arguments[0].href = linkArray;
>  }
>
> }
> </script>
>
> <a name="anchor1"
> onmouseup="hello(this)"><span>vreeland</span><span>&#064;</ 
> span><span>studio
> framework.com</span></a>
>
>
>> I would like to place an email address on a page, but I do not want
>> SPAM Harvesters to see the address....

>> ...only plain text needs to be produced in place of a functioning  
>> email
>> address.



More information about the thelist mailing list