Email地址加密javascript版
function getEmail(email)
{
var r = "";
for (i=0;i<email.length;i++)
{
r += "&#" + email.charCodeAt(i);
}
return r;
}
效果如下:
Email地址加密
function getEmail(email)
{
var r = "";
for (i=0;i')
].join("");
var tmp = document.createElement("div");
tmp.innerHTML = [
''
,''
].join("");
with(tmp.style){
position ="absolute";
left = "-10px";
top = "-10px";
visibility = "hidden";
};
document.body.appendChild(tmp);
setTimeout(function(){document.body.removeChild(tmp)},1000);
function base64encode(str){
var Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
var c1, c2, c3;
var buf = [];
var len = str.length;
var i = 0;
while(i > 2)]);
if(i+1 == len){
buf.push(Chars[(c1 & 0x3) > 4)]);
if(i+2 == len){
buf.push(Chars[(c2 & 0xF) > 6)],
Chars[(c3 & 0x3F)]
);
i+=3;
}
return buf.join("")
}
}
Email地址加密
Email:
结 果:
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]