Unfortunately, too many sites rely on JavaScript, so disabling it isn't a practical solution for most people. You may want to try JavaScript Blocker to see if it helps. This is the first report I've read about anyone having problems with JavaScript, so it's possible that there's something unique about your configuration that's causing the problem.
GGJ, with all due respect it's clear that there is something wrong with ML when it comes to battery life in some models - probably a buggy running process under Safari or so.
This has NOTHING to do with javascript or the like - Apple needs to fix this.