//特殊字符转换
var empNameArr = employee_name.split("");//字符串转成数组
employee_name = "";
for(i=0;i<empNameArr.length;i++){
var k = empNameArr[i].indexOf("+");
var l = empNameArr[i].indexOf("%");
var p = empNameArr[i].indexOf("&");
if(k == 0){
empNameArr[i] = "%2B";
}else if(l == 0){
empNameArr[i] = "%25";
}else if(p == 0){
empNameArr[i] = "%26";
}else{
}
employee_name += empNameArr[i];
}
url传参时特殊字符转换+&%
最新推荐文章于 2021-06-20 23:04:24 发布