An
Anti-Spam Technique for Email Addresses on the Web |
|
»
Email Spam:
 |
It
is arguably the biggest problem on the internet, and we all
hate it...
yes, I'm talking about Spam Emails.
Unfortunately,
there isn't exactly any one single fool proof method of dealing
with spam, but we don't have to sit back and live with it.
On
my website, I use a simple technique (using javascript to
display the email address) in the hopes of preventing spam
bots from acquiring my email address. The method is highlighed
below. Fortunately for us, (most?) spam bots have yet to figure
out how to read javascript source codes and that is what I use
on my site.
|
JavaScript
Source Code:
Here's
the JavaScript Source Code that you can customize by modifying
the parts highlighted in red. |
<script language="JavaScript">
<!--
var UserDomain = "umar.biz";
var UserName="umar";
document.write('<a href=\"mailto:' + UserName + '@' +
UserDomain + '?subject=Comments on Your
Website\" title=\"Click
here to send an email to Umar Ruhi\">');
document.write(UserName + '@' + UserDomain + '</a>');
// -->
</script> |
Instructions: |
-
copy and paste the code into any HTML editor or NotePad;
- insert
two parts of your email address instead of variables "UserDomain"
and "UserName";
- modify
the subject and the title (make sure you don't remove any other
punctuation including the quotes and the slashes);
- paste
the code into your Home Page;
- you
may put any HTML formatting tags (for instance, <p align="center">
</p>) to align the address. |
P.S.
Feel free to share this technique with others. |
|