Tuesday, December 6, 2011

Get Rid of Email Spam with jQuery Spamless


Get Rid of Email Spam with jQuery Spamless
by: Marvin
Protect your learn web design site against email spam with this lightweight and very useful jQuery plugin called jQuery Spamless. The plugin is designed by web developers at Design Chemical , which prevents spam from entering your blog, thus making your blog posts and blogging activity hassle-free. What it does is to convert indistinct email addresses which are hard to detect by spam harvesters into human-readable content in the browser.

The jQuery plugin has several options which you can customize according to the security level and allows you to control how you would want to write the email.
1.       Customize the characters you want to use to replace “@” symbol and “.” symbol in the domain name.
2.       Increase your web site security by choosing whether to convert the reversed text which is its default setting into a huma- readable email address.

3.       It detects automatically href text if used in an email link and converts it.
4.       It gives you the option to convert confusing email addresses into a mailto links.
Here’s how to use the plugin:
1.       Add this plugin to the head of your document.
<script type='text/javascript' src='js/jquery.dcspamless.1.0.js'></script>

2.       Email HTML
You can use the jQuery Spamless plugin in several ways. For the default settings – reverse text and “.” Symbol in the domain name changed by “(dot)” and “@” symbol changed by ”(at)”, email can be entered as mailto link or as text inside HTML tag.
If you use a mailto link, it will detect the link automatically.
Use this HTML to add the email “email.address@domain.com”:
Mailto link:
<a href="mailto:moc[dot]niamod[at]sserdda.liame" class="email">Contact Us</a>
Text:
<span class="email">moc[dot]niamod[at]sserdda.liame</span>


3.       Initialize the plugin
jQuery(document).ready(function($) {
$('.email').dcSpamless();
});
You can change the email spam settings.
Below is the plugin default.
var defaults = {
    reverse: true,  // select whether the email text is reversed
    splitDomain: '[dot]', // characters used to replace '.'
    splitName: '[at]', // characters used to replace '@'
    mailto: true    // select whether to add mailto link for text
};
Overriding the default options.
You can override the default options by passing an object into the plugin upon initialization.
$('.email').dcSpamless({
    reverse: false,
    splitDomain: '//',
    splitName: '/',
    mailto: false                                                                          
});
                               

No comments:

Post a Comment