encodeURI()函数和encodeURIComponent()函数

encodeURI() 函数和encodeURIComponent()函数都是用来进行编码的

区别:

encodeURI() 函数不可以对以下字符进行编码: , / ? : @ & = + $ #   使用decodeURI() 方法可以解码URI

encodeURIComponent()函数可以对以下字符进行编码: , / ? : @ & = + $ #  使用 decodeURIComponent() 函数对编码的 URI 组件进行解码。

猜你喜欢

转载自blog.csdn.net/m0_73334325/article/details/132433261