From http://stackoverflow.com/questions/1144783/replacing-all-occurrences-of-a-string-in-javascript #javascript
var find = 'abc'; var re = new RegExp(find, 'g'); str = str.replace(re, '');