Adding escaping to JavaScript output for improved security