how can I use javascript to hide an email address with an image link from spambots?

Discussion in 'Javascript' started by Millie, Nov 14, 2003.

  1. Millie

    Millie Guest

    Okay, I'm using this code

    <script language=JavaScript>
    <!--
    var username = "username";
    var hostname = "domain.com";
    var linktext = "click here to send me email";
    document.write("<a href=" + "mail" + "to:" + username +
    "@" + hostname + ">" + linktext + "</a>")
    //-->

    </script>

    in an attempt to cut down on the whole spam problem. However, I have
    an image link that I would like to use this with. Now, I'm sorry I'm a
    newbie at this, so I hope this isn't a stupid question, but what is
    the correct code to do this with an image link?

    TIA
     
    Millie, Nov 14, 2003
    #1
    1. Advertising

  2. In article <>,
    says...
    > Okay, I'm using this code
    >
    > <script language=JavaScript>
    > <!--
    > var username = "username";
    > var hostname = "domain.com";
    > var linktext = "click here to send me email";
    > document.write("<a href=" + "mail" + "to:" + username +
    > "@" + hostname + ">" + linktext + "</a>")
    > //-->
    >
    > </script>
    >
    > in an attempt to cut down on the whole spam problem. However, I have
    > an image link that I would like to use this with. Now, I'm sorry I'm a
    > newbie at this, so I hope this isn't a stupid question, but what is
    > the correct code to do this with an image link?
    >

    Change
    var linktext = "click ...";
    to something like
    var linktext = "<img src=\"mypic.gif\">";

    --
    Hywel I do not eat quiche
    http://hyweljenkins.co.uk/
    http://hyweljenkins.co.uk/mfaq.php
     
    Hywel Jenkins, Nov 14, 2003
    #2
    1. Advertising

  3. Re: how can I use javascript to hide an email address with an imagelink from spambots?

    Millie wrote:

    > Okay, I'm using this code
    >
    > <script language=JavaScript>


    <script type="text/javascript">

    > [scriptkiddie's bullshit]
    > in an attempt to cut down on the whole spam problem [...]


    and replace it with a usability problem. Great.


    PointedEars, wondering why so few people read before they post
     
    Thomas 'PointedEars' Lahn, Nov 18, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Miguel Dias Moura
    Replies:
    4
    Views:
    1,146
    Zenobia
    Jun 26, 2004
  2. Hans-Marc Olsen

    Can I write spyware, spambots and worms in C ? ? ?

    Hans-Marc Olsen, Nov 18, 2004, in forum: C Programming
    Replies:
    6
    Views:
    496
    beatles
    Nov 18, 2004
  3. Brian Raab
    Replies:
    2
    Views:
    111
    Martin DeMello
    Oct 8, 2004
  4. luke
    Replies:
    10
    Views:
    189
  5. Ian James

    Hiding email address from spambots

    Ian James, Jun 6, 2005, in forum: Javascript
    Replies:
    8
    Views:
    135
    Thomas 'PointedEars' Lahn
    Jun 16, 2005
Loading...

Share This Page