A javascript will only work if the viewer has javascript enabled, of course.
Some 'forms' code still include the complete address in the html page. I question our hosting company when I downloaded their form template, the only 'hiding' is that the name of that item is "hidMAIL_TO". I wanted to use a program that creates completely ASCII addresses ( it can also create javascript code ), but their Perl scripts weren't set up to handle that. We use form irregularly, and for only a short time, so it wasn't worth the effort to write new Perl scripts (even if I knew how!).
I hide any and all email addresses on our site by using "<
SpamStopper>" from Railhead Design. It's completely free, has several different hiding capabilities in ASCII or javascript, it's extremely easy to use and, did I mention it's
FREE?!
(Had to insert spaces between the ASCII number and the ":" to keep the software fro converting everything back into readable characters! So much for "Code" or "Codebox" being useful for
all code text...)
CODE
<a href="m ;a ;i ;l ;t ;o ;: ;j ;o ;h
;n ;d ;o ;e ;@ ;a ;n ;i ;s ;p ;. ;n ;e
;t ;? ;s ;u ;b ;j ;e ;c ;t ;= ;A ; ;Q ;u
;e ;s ;t ;i ;o ;n ; ;a ;b ;o ;u ;t ;
;y ;o ;u ;r ; ;s ;i ;t ;e ;">C ;o ;n ;t
;a ;c ;t ; ;u ;s ;! ;</a>
The above is using the "Full Paranoid" setting!
It translates into a browser displayed link "Contact us!"; that's all the user sees. When the link is clicked, the usual opening of an email app occurs and the viewer can enter any text she wants, your address, the "Subject:A Question" about your site" is also filled in in the email page. Obviously, the "Subject:" can be anything you want, and it's great to use something specific that you can filter with your email program.
And the display text can also be whatever you want, of course.
So far, I don't know of any bot/spider that goes to the trouble of
decoding ASCII.
An the whole process takes as long as it would to type the email address, the 'Subject', the display text and the anchor html. One click then creates the html, another button puts it onto the clipboard. Click on your html editor page and command-V where it goes. Done.
May be overkill and not 100% effective but it sure is easy and the cost is perfect!