help with javascript library

Sharky Forums


Results 1 to 3 of 3

Thread: help with javascript library

  1. #1
    Expensive Sushi
    Join Date
    Sep 2003
    Location
    Chess
    Posts
    29

    help with javascript library

    i'm trying to create a javascript function that will hide my email address from spyders.

    i've added the following function to my library

    function SecureMailTo(user,domain,ext)
    {
    var first = 'ma';
    var second = 'il';
    var third = 'to:';

    document.write('<a href="');
    document.write(first+second+third);
    document.write(user);
    document.write('&#64;');
    document.write(domain);
    document.write('.');
    document.write(ext);
    document.write('">');
    document.write('Email Me</a>');

    }

    my javascript debugger says there are no syntax errors on the page...
    but i'm having trouble implementing this library into my web document

    here is my code for my document

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <!-- Copyright: BnPayne
    Date: 2/1/04
    -->
    <head>
    <script type="text/javascript" language="javascript" src="ChessLibrary.js">
    </script>

    </head>

    <body>
    <br />
    <script type="text/javascript" language="javascript">
    <!--

    SecureMailTo("bp","mydomain","com");

    //-->
    </script>
    script above

    </body>
    </html>


    any help in figuring out what i'm doing wrong would be appreciated

    thanks
    brandon

  2. #2
    Tiger Shark
    Join Date
    Oct 2000
    Location
    Erie, PA, USA
    Posts
    693
    Well what is the output of the script? (What does the page look like?)
    AMD AthlonXP 2600+ Thoroughbred B @ 200x10.5
    Shuttle AN35N nForce2 Ultra 400
    2x512MB Kingston PC3200 (3-3-3)
    ATI Radeon 9600 Pro
    40GB WD ATA-100 8MB cache
    Creative 12X DVD Drive
    Memorex 52X CD-RW
    Running Windows XP Pro

  3. #3
    Expensive Sushi
    Join Date
    Sep 2003
    Location
    Chess
    Posts
    29

    i figured it out

    i figured it out i was using the wrong comment tag... (html instead of js) whoops

    thanks anyway

Posting Permissions

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