How do I do a "mailto:" from within JS function?

R

Rick

I'm a novice at this and would appreciate your help.

Because of email address mining I would like to stay away from entering
(e-mail address removed) within my pages. I looked for and found "email riddler" at
dynamicdrive.com. This simply places the characters in ascii in an array
then puts them together when you click on the link.
<script type="text/javascript">

/***********************************************
* Encrypt Email script- Please keep notice intact.
* Tool URL: http://www.dynamicdrive.com/emailriddler/
* **********************************************/

var emailarray8007= new Array(97,98,99,64,99,100,101,46,99,111,109)
var postemail8007=''
for (i=0;i<emailarray8007.length;i++)
postemail8007+=String.fromCharCode(emailarray8007)

document.write('<a href="mailto:'+postemail8007+'">Contact Us</a>')

</script>

I made this script into a function which is called by an interactive button.
I need to replace the "document.write" with the command to do the "mailto:".
Is there such a thing?

Thanks for your advice.
Rick
 
K

Kevin Spencer

document.location = "mailto:" + postemail8007;

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top