Simpliest way to obfuscate e-mail address using jQuery

Here is a simpliest jQuery code to protect e-mail addresses on your website from spam bots. Just put this in a script tag into the head section:

$(window).load(function() {			
	// anti spam
	var r='random-string';
 
	$('.'+r).each(function() {
	var $this = $(this),
		value = new String($this.text());
 
		value = value.replace('['+r+']', '@');
 
		$this.replaceWith($('').text(value).attr('href', 'mailto:'+value));
	});
});

Now replace random-string with any really aleatory set of characters eg. dhhIDu338

And here is the HTML part. Publish every e-mail address on your page using this code:

Contact: <span class="random-string">johndoe[random-string]mail.com</span>

jQuery advanced filter list plugin

This is a plugin for realtime list filtering using a text input. It’s very simple in use. Look at examples below:

Init filter:

$(document).ready(function() {
$('ul.dynamic-search-list').filterList({
inputSelector: '#filter-input'
});
});

inputSelector is the only option required by plugin. It’s a jQuery selector for input field that will be used for list filtering.

Detach filter:

$('ul#2').filterList('detach');

Disable filtering for the specified list (by a selector).

Optional settings:

  • caseSensitive true|false – enable or disable letter case sensitivity (it’s turned off by default).
  • noResultsText string – text that appears if no element matches text (by default it’s english).
  • duration integer – animation speed in miliseconds.
  • zebra true|false – add even class to even elements on the list (true by default).

Demo:

Check demo at: http://realhe.ro/demo/jquery-filter-list/

Download: