Cool Fading Color Effect- -| 回首页 | 2004年索引 | - -菜鸟编程十大好习惯

Protect Your Email Address(保护你的邮箱地址)- -

                                      

The following java-script is a good way to help prevent spammers from grabbing the email addresses from your webpages.


The following code must be added to the head section of each webpage that you'd like to use this script in.



After the above code has been added to the head section, you then gain the ability to use the following from anywhere within the body section of your HTML source code.

daniel 'at' example.com

 

The 'example.com' section of this code will need to be replaced with your email providers domain, and the 'daniel' section will need to be replaced with the username that you have for that particular email account.

What this java-script actually does is takes these two pieces of data and then parses them into your full email address after you've clicked on the mailto link.

The example java-script would parse daniel@example.com in this case, once the link was clicked.

Spiders and robots that search your website won't see the code as an email address that they can gather and so your email should be safe from spiders and robots!


 

- 作者: 钟彬 2004年11月14日, 星期日 23:06 加入博采

Trackback

你可以使用这个链接引用该篇文章 http://publishblog.blogchina.com/blog/tb.b?diaryID=237456

回复

- 评论人:Sheneyan

Tue Dec 07 13:30:39 CST 2004 

java-script:mailto('example.com','daniel')??
写成javascript:mailto('example.com','daniel')吧?
我的做法和这不一样,不过效果是一致的,就是让机器人不认为这是一个地址……
我写成<a href="mailto:%64%61%6e%69%65%6c%40%65%78%61%6d%70%6c%65%2e%63%6f%6d">写信给我哦</a>

...不过我没找个机器人真正测试过,不确定是否成功-_-

评论内容: