The Artima Developer Community
Sponsored Link

.NET Buzz Forum
How to protect the email address from the evil spam bots

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Damir Tomicic

Posts: 2504
Nickname: damir
Registered: Apr, 2004

Damir Tomicic is Microsoft Regional Director for Germany and INETA Lead
How to protect the email address from the evil spam bots Posted: Jun 24, 2004 8:19 AM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Damir Tomicic.
Original Post: How to protect the email address from the evil spam bots
Feed Title: Damir Tomicic : community powered
Feed URL: http://tomicic.de/SyndicationService.asmx/GetRss
Feed Description: stuff about .NET, community and life - in several languages.
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Damir Tomicic
Latest Posts From Damir Tomicic : community powered

Advertisement

Nice peace of code found in FotoVision code library.

 1: /*
 2:  This function helps protect the
   email address from the evil spam-bots that scan 
 3:  web pages for email addresses.
   Instead of using the email address directly, the 
 4:  encoded value is stored in the html
   and decoded when required.
 5: */
 6: function sendEmail(encodedEmail)
 7: {
 8:  // The encodedEmail is a string
   that contains the email address.
 9:  // Each character in the
   email address has been converted into 
 10:  // a two digit number (hex / base16).
   This function converts the
 11:  // series of numbers
   back into the email address and displays the 
 12:  // email client with the mailto:
   protocol.
 13:  
 14:  // holds the decoded email address
 15:  var email = "";
 16:  
 17:  // go through and decode
   the email address
 18:  for (i=0; i < encodedEmail.length;)
 19:  {
 20:  // holds each letter (2 digits)
 21:  var letter = "";
 22:  letter = encodedEmail.charAt(i) + encodedEmail.charAt(i+1)
 23:  
 24:  // build the real email address
 25:  email += String.fromCharCode(parseInt(letter,16));
 26:  i += 2;
 27:  }
 28:  
 29:  // do the mailto: link
 30:  location.href = "mailto:" +
   email;
 31: }

Read: How to protect the email address from the evil spam bots

Topic: Ebay comes to India Previous Topic   Next Topic Topic: Gmailto

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use