SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2003
    Location
    UK
    Posts
    85
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Spam Proof Email Link

    Ok,

    I am trying to make an image into a mailto link, where the link is formed via som JavaScript so to avoid spamming robots. Here is the code:

    Code:
     <script language=javascript> 
    <!-- 
    var username = "hosting"; 
    var hostname = "bluepointwebdesign.co.uk"; 
    var linktext = username + "@" + hostname; 
    document.write("<a href=" + "mail" + "to:" + username + 
    "@" + hostname + ">" + "<img src=""\"/images/hosting_email.gif\">" + "</a>" )
    //--> 
    </script>
    
    Everything works, but the image won't be displayed!

    Any help would be much appreciated.

  2. #2
    SitePoint Enthusiast
    Join Date
    Jan 2003
    Location
    UK
    Posts
    85
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Solved it myself

    Just need to get rid of the / in front of images

    <script language=javascript>
    <!--
    var username = "hosting";
    var hostname = "bluepointconsulting.co.uk";
    var linktext = username + "@" + hostname;
    document.write("<a href=" + "mail" + "to:" + username +
    "@" + hostname + ">" + "<img src=""\"images/hosting_email.gif\" " + " border=0" + ">" + "</a>" )
    //-->
    </script>

    Thanks any way....good to talk to someone about it


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •