其他分享
首页 > 其他分享> > js中的编码和解码

js中的编码和解码

作者:互联网

# 方案一

1. encodeURI() 函数用于对 URI 进行编码

  > 此函数对特殊字符进行编码,除了: , / ? : @ & = + $ #(请使用 encodeURIComponent() 对这些字符进行编码)

2. decodeURI() 函数对已编码的 URI 进行解码

 

# 方案二

1. encodeURIComponent() 函数进行编码

2. decodeURIComponent() 函数解码

标签:编码,函数,解码,URI,js,encodeURIComponent,进行
来源: https://www.cnblogs.com/G-Lose/p/15978390.html