`encodeURI` 和 `encodeURIComponent`的区别
encodeURI 和 encodeURIComponent的区别encodeURI 加密一些URL中不允许的字符, 如空格等var url = 'http://xx xxx/';
encodeURI(url);
// 输出: "http://xx%20xxx/"encodeURIComponent 加密query string中的一些特殊字符var url = 'http://xx xxx/';
原创
2015-12-08 12:29:43 ·
373 阅读 ·
0 评论