JavaScript is a client side programming language. When we can all code generator, we return as key whatever your http server throws at us .. and that will your page content. That's why you will need to write your code generator in server side scripting language and ensure that the only output we get is the code itself.