部分浏览器不支持 replaceAll的解决


使用replace+正则代替replaceAll

str.replace(/要替换的内容/g,"xxxxxx")

// 或者

str.replace(new RegExp(要替换的内容, "gm"), "xxxxxxxx")

增加 Polyfill

String.prototype.replaceAll = function(s1, s2){
	return this.replace(new RegExp(s1, "gm"), s2);
}