源码:
<script>
var url="http://www.jianshu.com/abc?123.html"
var jiami=encodeURIComponent(url);
console.log(jiami);
console.log(decodeURIComponent(jiami))
</script>
输出:
http%3A%2F%2Fwww.jianshu.com%2Fabc%3F123.html
源码:
<script>
var url="http://www.jianshu.com/abc?123.html"
var jiami=encodeURIComponent(url);
console.log(jiami);
console.log(decodeURIComponent(jiami))
</script>
输出:
http%3A%2F%2Fwww.jianshu.com%2Fabc%3F123.html
本文标题:JS案例21-给网址加密和解码-个人感觉虽然冷门,但是很有用
本文链接:https://www.haomeiwen.com/subject/moshtqtx.html
网友评论