encodeURI和encodeURIComponent函数是把字符串作为url进行编码的函数
var a="YR9+vMNNxTRiLzD9YgiIrQ==" var b=encodeURIComponent(a); var c=encodeURI(a); console.log(b);//输出结果:YR9%2BvMNNxTRiLzD9YgiIrQ%3D%3D console.log(c);//输出结果:YR9+vMNNxTRiLzD9YgiIrQ==
因为入过坑,在此谨记
京公网安备 11010502049817号