If a javascript string contains ASCII codes as a result of escaping HTML characters, to convert them into text, use the String.fromCharCode(); and replace functions as follows
str.replace(/&#(\d+);/g, function (m, n) { return String.fromCharCode(n); });
String.fromCharCode() is a static function and will be called by passing the string variable and using ‘String’ only. ie not like other string functions eg str.replace()
