Fixed #21725 -- Fixed JavaScript quoting encoding.

Thanks to nedbatchelder for the report.