2

Possible Duplicate:
Javascript heredoc

I am trying to figure out the equivalent of the "here printing" from Perl (<<) for Javascript, but I don't seem to find the answer.

Community
  • 1
  • 1
Raisen
  • 4,385
  • 2
  • 25
  • 40
  • There isn't one. Also, this is a dup: http://stackoverflow.com/questions/4376431/javascript-heredoc – Wayne Apr 17 '11 at 04:02
  • An even older duplicate, with more detailed answers: http://stackoverflow.com/questions/805107/multiline-strings-in-javascript , courtesy of Raisen's comment in accepted answer. – Chadwick May 11 '11 at 22:00

1 Answers1

1

There seems to be a bit of a clumsy way of doing it in later JavaScript versions. I snagged this from a blog entry.

var string = (<r><![CDATA[

     The text string goes here.  Since this is a XML CDATA section,
     stuff like <> work fine too, even if definitely invalid XML.

  ]]></r>).toString();
JUST MY correct OPINION
  • 35,674
  • 17
  • 77
  • 99
  • Awesome. That gave me some hints on what to look for and I found a working one here: http://stackoverflow.com/questions/805107/multiline-strings-in-javascript Thanks – Raisen Apr 17 '11 at 04:16