{{error}}
{{(quickSearchResults.length>10)?'10+':(quickSearchResults.length)}} {{(quickSearchResults.length==1)?'result':'results'}}
{{result.title}} {{result.timeStamp | mysql2ymd }}
I am sorry, no such article was written yet.
Email obfuscator
Email obfuscator
When I decided to publish my CV on a web page (http://dragos-matei.sorescu.eu) I wanted to publish also my email, but without letting the bots read it.
So, I came with the following solution:
  1. encode the email in some kind;
  2. let the browser decode it after the page gets loaded.
For this I used the following encoded text:
	
		<%icon:email%>[b36]831898108[b36][b36]1348423876[b36]@[b36]27913917[b36].[b36]16438[b36]
	
The JavaScript to decode it is attached.
A small demonstration of the algorithm is put also below:
SourceEncodingDecoding
 
 
Decode.js
$(function(){
		var nodes=$('.obfuscatedEmail');
		for(var nodeId=0;nodeId<nodes.length;nodeId++){
			var node=$(nodes[nodeId]);
			var innerText=(''+node.html()).split("[b36]");
			for(var i=1;i<innerText.length;i+=2)
				innerText[i]=(1*innerText[i]).toString(36);
			node.html(innerText.join(''));
		}
	});