javascript replaceall is not a function