Javascript String replaceAll(strReplace, strWith)
String.prototype.replaceAll = function(strReplace, strWith) { var reg = new RegExp(strReplace, 'ig'); return this.replace(reg, strWith); };