转载http://www.iteye.com/topic/67544
挺好用滴
String.prototype.replaceAll = function(s1,s2){
return this.replace(new RegExp(s1,"gm"),s2);
}
挺好用滴