Refactor the Javascript.

Change a print to a log.