×
Request a Proposal
Facebook Instagram Twitter Youtube Google+

THATBlog

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

Posted at Mar 19, 2009 12:41:26 PM by Ronald Busky | Share

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

RECENT POSTS
2019 Digital Marketing Guide | THAT Agency