Javascript compiles and runs