Fighting spam from inline email addresses using JQuery Plugin - Version 1.0

19 March

Fighting spam from inline email addresses using JQuery Plugin - Version 1.0

This is a JQuery plugin I have been working on to try to eliminate; if not help, fight spam through bots and such going through websites and scraping email addresses.

Basically it works like this: You add the emails in a certain way in your code, be it yourname^yourcompany#com or however you want to add it. Then let the plugin work its magic. The code will be shown as above, but will behave as if you had typed in yourname@yourcompany.com. Simple huh? Well here we go:

Javascript


$(document).ready(function(){
// example 1
$('a[rel*=spemail]').spemail('|,:','linkbase');
// example 2
$('#email').spemail('|,:','mailbase');
// example 3
$('#plainemail').spemail('|,:','plainbase');
});

HTML


<strong>Example 1:</strong> <a href="com" rel="spemail"></a>

<strong>Example 2:</strong> <span>yourname|yourcompany:net</span>

<strong>Example 3:</strong> <span>yourname|yourcompany:net</span>

As you can see in the examples above, the code in the DOM, will handle specific email pieces based on their ID or rel. Try it out and see. It works well.

Check out a live example of Fighting spam from inline email addresses using JQuery

or

Download the Fighting spam from inline email addresses using JQuery Plugin - Version 1.0 source files

TAGS: Web Development, What's Trending, General