← Previous | Next →

Code generated by the scramble form:

Below is an abbreviated form of the code generated when you pressed the Scramble button on the form. To see all of the code generated, jump to the full-code page.

  1.     $(document).ready(function() {
  2.       $('#btnSend').click(doClick);
  3.     });
  4.     function doClick() {
  5.       var mlChars = 'mnescooaai:id.odsssrodmlmma eo@emt';
  6.       var mlKey = '022029011018031025005027012002006028013030021014020017008015009024000003010033001007016032019023026004';
  8.       $(frmId).attr('action', deScramble(mlKey, mlChars));
  9.       $(frmId).submit();
  10.     }
  11.     function deScramble(mlKey, mlChars) {
  12.     }
  13.     <form id="frmSend">
  14.       <p><button id="btnSend" class="sendBtn" type="button">
          Send an e-mail</button></p>
  15.     </form>

The code of interest begins on line 9 with an anonymous javascript function that sets the OnClick event of the Send an e-mail button to the doClick function that begins on line 12, so that when the button is clicked, the doClick function is called. The doClick function contains two variables:

  • mlChars contains a scrambled e-mail address string, that when unscrambled is "mailto: someaddress@somedomain.com"
  • mlKey contains the key string for unscrambling the address string in which the proper order of each character in the scrambled string is stored as a zero-padded three-digit integer string. For example "015".

The doClick function calls the deScramble function (which begins on line 23) to unscramble the address and set the action attribute of the form to action = "mailto: someaddress@somedomain.com". It then triggers the submit event so the action takes place.

Starting on line 58 the code contains a simple form in the <body> of the page that contains the Send an e-mail button. This insures that the e-mail address is not easily found by search bots.

Now, let's get really paranoid. On the next page we're going to really scramble things up.

← Previous | Next →