let url = 'https://www.baidu.com/'
let urlencode = encodeURIComponent(url) //对 URI 进行编码
console.log(urlencode) // https%3A%2F%2Fwww.baidu.com%2F
let urldecode = decodeURIComponent(urlencode) //对 URI 进行解码
console.log(urldecode) // https://www.baidu.com/
URL的解码与编码
最新推荐文章于 2024-08-23 02:13:46 发布
关键词由CSDN通过智能技术生成