关于encodeURI和encodeURIComponent的使用场景

2022年6月8日10:17:58
  1. encodeURI:适用于url跳转时。
  2. encodeURIComponent:适用于url作为参数传递时。
  3. tips:当url作为参数传递时如果没有用encodeURIComponent进行编码,会造成传递时url中的特殊字符丢失。
  • 作者:莱恩-哈特
  • 原文链接:https://blog.csdn.net/wangongda/article/details/79734008
    更新时间:2022年6月8日10:17:58 ,共 115 字。