至尊技术网 - decodeURI
https://www.zzwws.cn/tag/decodeURI/
-
js执行提示Uncaught URIError: URI malformed
https://www.zzwws.cn/archives/6342/
2022-06-06T22:50:00+08:00
由于decodeURI转码时,通过%进行解析,如果字符串中存在%则会出现URI malformed解决方法将字符串中的%替换为25%就行了var str = '1%2';
if(str.indexOf('%') > -1) {
str = str.replace(/%/g,'%25');
}