JS原生加密解密encodeURI/decodeURI

180it 2021-09-03 PM 1619℃ 0条
<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>JS加解密</title><style>body{ margin:0; text-align:center}textarea{ margin:0; width:60%; height:200px;}

</style></head><body>

<p id="wz" style='color: #C00;margin-top:30px;'><textarea id="codeinp" name="contents" class="toolarea" placeholder="请把你需要加解密的JS代码粘贴在这里。"></textarea></p>

<input  id="jiami" type='button' style=' width:200px; height:60px; color: #FFF; background-color:#C30; font-size:20px' value='encodeURI' onclick="jiami()" />

<input  id="jiemi" type='button' style=' width:200px; height:60px; color: #FFF; background-color:#C30; font-size:20px' value='decodeURI' onclick="jiemi()" />

<script language="javascript">

function jiami(){

var str=document.getElementById('codeinp').value;

document.getElementById('codeinp').value=encodeURI(str);

}

function jiemi(){

var str=document.getElementById('codeinp').value;

document.getElementById('codeinp').value=decodeURI(str);

}

</script>

</body>
</html>
支付宝打赏支付宝打赏 微信打赏微信打赏

如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!

标签: none

JS原生加密解密encodeURI/decodeURI