Click to See Complete Forum and Search --> : javascripted maito email launched via image click


jeff111
09-09-2003, 06:51 PM
This is probably a dumb question but...
With the email protector code below that Ive seen elsewhere, how do I launch this type of "maito" email by clicking an image (I dont want the link text)? Ive tried to include an image src and also get it to run as a function, but I dont know enough about scripting. Any suggestions appreciated.

user = "username";
site = "yoursite.com";

document.write('<a href=\"mailto:' + user + '@' + site + '\">');
document.write(user + '@' + site + '</a>');

requestcode
09-09-2003, 09:12 PM
Try this:
document.write('<a href=\"mailto:' + user + '@' + site + '\">');
document.write('<img src="pic.gif" name="mypic" border="0"></a>');

jeff111
09-09-2003, 10:01 PM
Thanks, that works well.:) :)