Put JavaScript-only code where it should be.