- encodeURI:适用于url跳转时。
- encodeURIComponent:适用于url作为参数传递时。
- tips:当url作为参数传递时如果没有用encodeURIComponent进行编码,会造成传递时url中的特殊字符丢失。
关于encodeURI和encodeURIComponent的使用场景
猜你喜欢
转载自blog.csdn.net/wangongda/article/details/79734008
今日推荐
周排行