On my websites, I use the web-based Automatic Enkoderform to do javascript encoding. http://automaticlabs.com/products/enkoderform
Just cut and paste the results into your code. No email that I have set up exclusively to use as web site email contact, and encoded this way, has ever gotten spam. I've used it both to replace "mailto:" URLs directly on the page, and to obscure the email address in scripted email contact forms.
The results of this encoding pass the reliableanswers.com email extracting test.