js中有方法replace可对字符进行替换,但是替换的只是第一个你要替换的字符,因此要自定义一个方法
String.prototype.replaceAll = function (FindText, RepText) {
return this.replace(new RegExp(FindText, "g"), RepText);
}
// console.log(pro.replaceAll('"','\"'));
var proStr=pro.replaceAll('"','\"')//替换的元素