Added the one true javascript handling code