|
All
email addresses use the “at” symbol (@), and spiders are taught to look
for them. HTML symbols are written directly into the HTML code,
but are interpreted by the browser into their actual meaning. The
HTML symbol for the “@” sign is @. So, how
do we implement something like this?
<a href="mailto:name@domain.com">
All
we do is replace the @ sign with the HTML symbol that represents
it. This method, however, is sometimes caught by more sophisticated
software. Although most are not quite as advanced, they do exist.
How do we surpass this hurdle? One way is by using JavaScript.
Using
JavaScript, we will simply break up the e-mail address into four
different sections, 1: name, 2: the @ sign, 3: domain, 4: extension.
Here is a simple implementation of JavaScript to perform this action.
<script type="text/javascript">
name ="you"
domain ="domain"
extension =".net"
document.write('<a href="mailto:' + name + '@' + domain + extension
+' " ' +' >e-mail link here ');
</script>
The
above code is fairly self-explanatory. We define three variables,
name, domain and extension, and simply concatenate those variables
within a “document.write” statement to the browser.
Notice we use HTML's anchor tags within the write statement so
your browser will interpret the email link correctly.
There
is another problem with using this method. JavaScript is client-side,
which means although spiders might not be able to interpret your
email address; browsers with JavaScript capabilities turned off
will not either, meaning your e-mail address will not be displayed
to the user.
How
do we fix this problem? Can we get away with refusing to display
any email address? Yes, but we still must provide a way for the
user to contact us. The solution is a rather simple email form.
The
third might be the only full proof method of protecting yourself
against spam spiders, and that is simply refusing to display your
e-mail address. Instead, if your server supports server-side processing
(like Perl, ASP, Cold Fusion or PHP), simply design a feedback
form, and call a server-side script to process the data behind
the scenes.
Please
note that if your server does not support any server-side programming
language, you are out of luck in this regard. Chose between the
two aforementioned methods.
|