Get best price on Apple iPhone 11 | ||||||||||||
|
||||||||||||
|
JavaScript : Hiding Email AddressesAlso known as Fooling SpamBots, this JavaScript code example makes it difficult
for SpamBots to automatically obtain email addresses when they scan your web pages. The JavaScript
function breaks your email address into components and re-assembles the
components for display on the page.
Here's the code for the function:
<SCRIPT LANGUAGE="JavaScript">
<!-- var lhs = "web"; var rhs = "blazonry.com"; function print_mail_to_link() { document.write("<a href=\"mailto"); document.write(":" + lhs + "@"); document.write(rhs + "\">" + lhs + "@" + rhs + "<\/a>"); } //--> </SCRIPT> Here's the code to call the function: This code goes where you want your mailto address to appear on the page.
<script language="JavaScript" type="text/javascript">
print_mail_to_link() </SCRIPT> A normal-looking email address link appears on your page and looks like: But nowhere in your HTML is there an email address that is intact and deciperable by SpamBots. (grin) Of course, you can modify the function to display the email address not as a link but as plain old non-linkable text.
|
privacy policy || © 1997-2016. astonishinc.com All Rights Reserved. |