Start | Time | IF | Date Object | Arrays | Avoid the work | Hide email | Random | Intigrate HTML | Test
Hiding your email address

Leaving your email address on a page for all to see is just inviting spam and even using the 'mailto' link will make it easy for spiders to find.
The normal HTML link is
<a href="mailto:someone@somewhere.com">someone@somewhere.com</a>
someone@somewhere.com
Spiders can search a site by key words so you can see that searching with '@' will give them 2 hits and searching with 'mailto' will give them one.
To fool them we need to move the @ so that it is not with your actual email address.
For this we will need 2 variables 'email_start' and 'email_end' and a document.write() statement.
<Script Language="JavaScript">
<!--
email_start = 'someone';
email_end= 'somewhere.com';
document.write(
'<a href="mailto:'+email_start+'@'+email_end+'"> email me </a>'
)
//-->
</Script>

If you wanted to actually show your email address on the page instead of 'email me' it could be done in the same way but usually a link is all you need.
Naturally it could also be a graphic.

As explained on the previous page you could make a JavaScript page called 'hide_email.js' and simply call on it wherever you wanted to put your email on your site.

Another handy thing you could do is to pass a variable to the script making it possible to change the 'email me' to something more fitting to the page.
I'll show you what I mean.
Let us add another variable to the script before saving it as 'hide_email.js'
We will call it 'email_show' and will not assign a value to it.
email_start = 'someone';
email_end = 'somewhere.com';
document.write(
'<a href="mailto:'+email_start+'@'+email_end+'"> '+ email_show + ' </a>'
)
Save the above as 'hide_email.js'
Now in order to put your email on a page you will need to assign a value to 'email_show' and then call the script 'hide_email.js'
<Script Language="JavaScript">
<!--
//assign a value to 'email_show'
email_show = ' My Email ';
//-->
</Script>


<Script Language="JavaScript" src="hide_email.js"></Script>


Next : Random changes

Home