encodeURI() 函数和encodeURIComponent()函数都是用来进行编码的
区别:
encodeURI() 函数不可以对以下字符进行编码: , / ? : @ & = + $ # 使用decodeURI() 方法可以解码URI
encodeURIComponent()函数可以对以下字符进行编码: , / ? : @ & = + $ # 使用 decodeURIComponent()
函数对编码的 URI 组件进行解码。
encodeURI() 函数和encodeURIComponent()函数都是用来进行编码的
区别:
encodeURI() 函数不可以对以下字符进行编码: , / ? : @ & = + $ # 使用decodeURI() 方法可以解码URI
encodeURIComponent()函数可以对以下字符进行编码: , / ? : @ & = + $ # 使用 decodeURIComponent()
函数对编码的 URI 组件进行解码。