jeudi 26 mars 2015

How can I send a response that is a block of code in a node request response function?


I am trying to have a server side function return a block of code. For example, I want to send the following back after a request:



$('body').css('background-color', 'blue')


What I did was wrap this in quotes and have the following response:



res.end("$('body').css('background-color', 'blue')");


However, as I write many lines code, I want to be able to write it without quotation marks. How can I store many lines of code in one variable perhaps so that I can write res.end(codesnippet)?





Aucun commentaire:

Enregistrer un commentaire