SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Who is Mr Blonde? Mr Blonde's Avatar
    Join Date
    Sep 2006
    Location
    Gold Coast, QLD
    Posts
    359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    preventing spam with javascript

    In an effort to prevent spam to my email addresses i've used a method found here. This is what it generates for 'example@test.com'.
    Code:
    <script type="text/javascript">
    
    /***********************************************
    * Encrypt Email script- Please keep notice intact.
    * Tool URL: http://www.dynamicdrive.com/emailriddler/
    * **********************************************/
    
    var emailarray7244= new Array(101,120,97,109,112,108,101,64,116,101,115,116,46,99,111,109)
    var postemail7244=''
    for (i=0;i<emailarray7244.length;i++)
    postemail7244+=String.fromCharCode(emailarray7244[i])
    
    document.write('<a href="mailto:'+postemail7244+'">+postemail7244+</a>')
    
    </script>
    I thought this looked fine so i used it some email addresses but it wasnt untill i checked the source code that i saw it is displayed as
    HTML Code:
    <script type="text/javascript" language="javascript">
    document.write('<a href="mailto:'+postemail7244+'">'+postemail7244+'</a>')
    </script><a href="mailto:example@test.com">example@test.com</a>
    Does this defeat the purpose of going through the whole process in the 1st place???
    Heavens Rejects : Online Clothing Store
    Alternative Clothing : Mr Blonde
    Front end development : By the Webfella

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Your post makes no sense. When you view the source you see exactly what you put in the source. That second block of code you posted is not in your webpage unless you put it there separately from the first block, which doesn't contain your e-mail in plain text anywhere. The page you linked does not give you any code containing your e-mail in plain text.

  3. #3
    Who is Mr Blonde? Mr Blonde's Avatar
    Join Date
    Sep 2006
    Location
    Gold Coast, QLD
    Posts
    359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i just checked the source again and its not there dont know what happened cos i copied and pasted that second code straight from the source and just replaced the email i was using with the example. sorry to stuff u around.. i just thought maybe javascript ran the function and put it into the html 1st
    Heavens Rejects : Online Clothing Store
    Alternative Clothing : Mr Blonde
    Front end development : By the Webfella


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
  •