escape | unescape |
編碼: | 解碼: |
encodeURI | decodeURI |
編碼: | 解碼: |
encodeURIComponent | decodeURIComponent |
編碼: | 解碼: |
原理:对除ASCII字母 数字 标点符号 @*_+-./ 以外的其他字符进行编码
編碼:escape('http://www.h3399.cn/')
解碼:unescape('http%3A//www.h3399.cn/')
原理:返回編碼爲有效的統一資源標識符(URI)的字符串,不會被編碼的字符:!@#$&*()=:/;?+'
編碼:encodeURI('http://www.h3399.cn/')
解碼:decodeURI('http://www.h3399.cn/')
原理:對URL的組成部分進行個別編碼,而不用于對整個URL進行編碼
編碼:encodeURIComponent('http://www.h3399.cn/')
解碼:decodeURIComponent('http%3A%2F%2Fwww.h3399.cn%2F')
原理:urlencode 将空格编码为加号"+"
編碼:urlencode('http://www.h3399.cn/')
解碼:urldecode('http%3A%2F%2Fwww.h3399.cn%2F')
原理:rawurlencode 将空格编码为加号"%20"
編碼:rawurlencode('http://www.h3399.cn/')
解碼:rawurldecode('http%3A%2F%2Fwww.h3399.cn%2F')