Affordable Web Design and Hosting     


 


 

Javascript to break apart email address

Thanks to Peter Griffith of London for creating this javascript to mask email addresses.  This one is ideal if you have a number of email addresses that you wish to publish on your site (i.e. a company directory)

The places you need to replace with your own information are highlighted in red.  The top part of the script needs to go in the HEAD of your html and the second goes in the BODY where you want the list to appear. 

This goes in the HEAD:

<SCRIPT language=javascript>
<!--

// This javascript was created by Peter R. Griffith
// You are welcome to use it for personal and non-profit purposes
// provided you retain this acknowledgement
// (c) 2001 Peter R. Griffith
//

arContact = new Array();
arContact[0]="";
arContact[1]="
President: John Doe";
arContact[2]="
Sales: Mike Smith";
arContact[3]="
Technical:  Bob Jones";

arAddress = new Array();
arAddress[0]="";
arAddress[1]="
jdoe";
arAddress[2]="
msmith";
arAddress[3]="
bjones";

var emailHost = "
yourdomainname.com"

function towhom(who)
{
document.write("<P><a href=" + "mail" + "to:" + arAddress[who] + "&#64" + emailHost+ "><FONT COLOR=#800000>" + arContact[who] + "</FONT></a>" + ".")
}
//-->
</SCRIPT>

This goes in the BODY:

<script language=javascript>
<!--
towhom(1);
towhom(2);
towhom(3);
//-->
</script>

This script will appear as follows:

 

Return to The Net Now

 


 Design
 Domains
 Hosting 
 Links
 Contact Us
 Home

BBBOnLine Reliability Seal

 




Click to pay 
an invoice

The Net Now
Privacy
Statement

 

Proudly serving Canada and the World from the "Forest City"
London, Ontario, Canada


Copyright 1998 - 2002 The Net Now.  All Rights Reserved. 
Reproduction in whole or in part in any form or medium without 
permission of The Net Now is prohibited.