SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist
    Join Date
    May 2005
    Posts
    411
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is there a better way to protect email from spam bots than using this javascript.

    Hey... I want to be able to display the email on the webpage... is there a better way than using this script:

    <SCRIPT type="text/javascript" language="javascript">
    <!-- Begin
    a="service";
    b="domain.com";
    document.write('<a href=\"mailto:'+a+'@'+b+'\">');
    document.write(a+'@'+b+'<\/a>');
    // End -->
    </SCRIPT>

    Also, can spam bots follow a javascript popup like this... can I put an email on a popup like this, without spam bots finding it?

    <a class="link3" href="#" onclick="window.open('http://www.domain.com/contacts/contact_12.htm','pop',config='height=500,width=623,top=20,left=20,toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,directories=no,status=no')"><b>Customer Service</b></a>

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,684
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    Consider what the end result is, that is rendered to the webpage.
    Note: this is different from the source code that people can see.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Wizard
    Join Date
    Dec 2003
    Location
    USA
    Posts
    2,582
    Mentioned
    29 Post(s)
    Tagged
    0 Thread(s)
    Basically, it's not really possible to block a spam bot from reading an email and remaining user-accessible. The only one they can't read are images (and even that isn't a sure thing) but then it isn't accessible to visually-impaired users.

    You'll basically just have to fight the spam coming into your inbox instead of trying to stop it from coming in.

  4. #4
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,789
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    The ones where it is guaranteed that they can't read the email address and never will are the ones that are not in the web page itself at all but are instead added to the email after the contact form is submitted.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


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
  •