title: JavaScript multiline strings and templating?
body: <p>I have been wondering if there is a way to define multiline strings in JavaScript like you can do in languages like PHP:</p>
  
  <pre><code>var str = "here
  goes
  another
  line";
  </code></pre>
  
  <p>Apparently this breaks up the parser. I found that placing a backslash \ in front of the line feed solves the problem:</p>
  
  <pre><code>var str = "here\
  goes\
  another\
  line";
  </code></pre>
  
  <p>Or I could just close and reopen the string quotes again and again.</p>
  
  <p>The reason why I am asking because I am making JavaScript based UI widgets that utilize HTML templates written in JavaScript. It is painful to type HTML in strings especially if you need to open and close quotes all the time. What would be a good way to define HTML templates within JavaScript?</p>
  
  <p>I am considering using separate HTML files and a compilation system to make everything easier, but the library is distributed among other developers so that HTML templates have to be easy to include for the developers.</p>