编码解码 encodeURIComponent与decodeURIComponent (base64编码解码)btoa与atob
var test1="http://www.w3school.com.cn/My first/" document.write(encodeURIComponent(test1)+ "<br />") document.write(decodeURIComponent(test1))
var str = "RUNOOB"; var enc = window.btoa(str); var dec = window.atob(enc);