JavaScript substr substring

NoSuchKey