Why is the \'/g\' required when using string replace in JavaScript?
e.g. var myString = myString.replace(/%0D%0A/g,\"\");
var myString = myString.replace(/%0D%0A/g,\"\");
The 'g' flag means "global" so each occurrence of %0D%0A will be replaced. Otherwise it would replace the FIRST occurrence only.