对cookie进行编解码用到的函数escape,unescape

<script>
alert(escape('abc123'))// escape对非ASCII字符进行编码,如空格等
alert(escape('a b c')+"-"+unescape('a b c'))// unescape解码
alert(escape('@a,b.c!')+"-"+unescape('@a,b.c!'))
</script>

猜你喜欢

转载自www.cnblogs.com/java-ty/p/12155248.html