Javascript: Simple way to protect your email address
There is several ways to protect your email address from being fetch by the spam email program. The fastest way is to use javascript.
Method 1: Use function()
Create your own unique funtion. For example.
function mailmask(id, domain){
document.write(id + ‘@’ + domain);
}
To use it, simply add this string between <body> and </body>:
<script>mailmask(’info’,'phixelcode.com’)</script>
Method 2: str.replace()
by using javascript built-in function, which is replace(). My example.
function replace_email(){
f = ‘{$$}’; // your desire key to replace
document.body.innerHTML = document.body.innerHTML.replace(f,’@');
}
Then add onload=”replace_email()” into <body> tag:
<body onload=”replace_email()”>
Then, to use it, type your email using this format:
fazlee{$$}gmail.com
Notice that i’m using {$$} to replace the @ sign. You can change it as you desired.
Popularity: 23% [?]
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.




Comments
No comments yet.
Leave a comment