• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Anti-spam email link using image

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I was wanting to use a javascript encrypted email link on my website ie.

somebody@veryhotmail.com
which would be written as: -
<script type="text/javascript">
spam='.com'
no='veryhotmail'
email=('somebody' + '@' + no + spam)
document.write('<A href="mailto:' + email + '">' + email + '</a>')
</script>
However if I want to use an image in place of "somebody@veryhotmail.com", how would I incorporate <img src="pic.gif">, for example, into the script?.
I can't seem to get this to work at all. Obviously some additional code is required to indentify the image for use within the script.
Hope someone can help out
Thanks Pundit.
 
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How about:
document.write("<a href=\"mailto:" + email + "\"><img src=\"mypic.gif\"></a>")
??
 
Ranch Hand
Posts: 4716
9
Scala Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
neils code looks correct to me.
pundit,
I hate to say this but, your name does not comply with the Javaranch naming guidelines which can be found at http://www.javaranch.com/name.jsp
please register again with a valid name.
[ August 07, 2002: Message edited by: Randall Twede ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic