How to cloak e-mail address
Many spiders or robots are designed for address-harvesting i.e, to extract email addresses from web pages for spam fuel. They scan web pages and harvest any strings that have the format username@domain.com(or .ext).
In order to hide your email address or protect it from these bots you can use simple Javascript code:
<script language="JavaScript">
<!--
emailname = "username"
emailserver = "domain.ext"
document.write("<a href='mailto:" + emailname + "@" + emailserver +"'>");
document.write(emailname + "@" + emailserver);
document.write("</a>");
-->
</script>
Place this snippet of code directly into the HTML copy, at the point where you want the email link. For example, if your email address is lookundertable@yahoo.com, your script would look like
<script language="JavaScript">
<!--
emailname = "lookundertable"
emailserver = "yahoo.com"
document.write("<a href='mailto:" + emailname + "@" + emailserver +"'>");
document.write(emailname + "@" + emailserver);
document.write("</a>");
-->
</script>
The line of code (document.write(emailname + "@" + emailserver);) determines what the link should say. If you want it to display "Wanna send me mail -- bingo!" then it would read document.write("Wanna send me mail -- bingo!"); You simply place the desired text in quotes between the parentheses. The way the line is scripted above, the link merely displays the email address itself. No matter what you set for the display, the email address will never show itself to spam harvesters.
You can also create a Javascript function to use in pages where your email address appears multiple times. The page has to be saved as an ASP page.
Paste the following code in the heading section (after <head> and before </head>).
<script language="JavaScript" RUNAT=SERVER>
<!--
function cloakml2 ( emailname, emailserver, text)
{
if (text == "") text = emailname + "@" + emailserver
return "<a href='mailto:" + emailname + "@" + emailserver +"'>" + text + "</a>";
}
-->
</script>
You can call the function in various ways:
==========================
example 1:
<p>My address is
<%
Response.write (cloakml2("lookundertable","yahoo.com", ""))
%>.</p>
Looks like
My address is lookundertable@yahoo.com.
==========================
example 2:
<p>My name is
<%
Response.write (cloakml2("lookundertable","yahoo.com", "Swirky-Mirky"))
%> and you can contact me!</p>
Looks like
My name is Swirky-Mirky and you can contact me!
Be sure to save the page with an ASP extension.
Hope you use it.....:cool: