1、JS中提供转义字符串和解析字符串的方法
解析字符串(decodeURIComponent)
let url = 'http%3A%2F%2Fbaidu.com%2Flogin' url = decodeURIComponent(url) console.log(url)
// http://baidu.com/login
转义字符串(encodeURIComponent)
let url = 'http://baidu.com/login' url = encodeURIComponent(url) console.log(url)
标签:http%,http,url,3A%,2F%,字符串 From: https://www.cnblogs.com/AllIhave/p/17014965.html