Js汉字和Unicode编码互转 Unicode加密 Unicode解密
加密是为了保护源代码;解密是为了看到源代码
参考文档:http://www.codefans.net/jscss/code/4794.shtml
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>汉字和Unicode编码互转</title> <script Language=Javascript> var classObj= { ToUnicode:function(str) { return escape(str).replace(/%/g,"\\").toLowerCase(); }, UnUnicode:function(str) { return unescape(str.replace(/\\/g, "%")); }, copyingTxt:function(str) { document.getElementById(str).select(); document.execCommand("Copy"); } } </script> </head> <body> <textarea id=codes style="width:500px;height:300px"></textarea><br><br> <input type=button value=Unicode加密 onclick=javascript:codes.value=classObj.ToUnicode(codes.value)> <input type=button value=Unicode解密 onclick=javascript:codes.value=classObj.UnUnicode(codes.value)> <input type=button value=复制文本 onclick=javascript:classObj.copyingTxt("codes")> <input type=button value=清空内容 onclick=javascript:codes.value=""> </body> </html>
相关推荐
86981633 2019-11-04
86530296 2020-11-10
周游列国之仕子 2020-09-21
88540591 2020-06-16
89411051 2020-06-14
mjshldcsd 2020-06-14
88384957 2020-06-12
84590091 2020-06-08
88540591 2020-06-04
88540591 2020-06-01
81214051 2020-06-01
84590091 2020-05-03
81214051 2020-04-25
honghao0 2020-04-24
84590091 2020-04-22
85271041 2020-04-10
88384957 2020-03-27