开发者

What's the equivalent of "here printing" in Javascript? [duplicate]

开发者 https://www.devze.com 2023-02-25 21:43 出处:网络
This question already has answers here: Closed 1开发者_开发问答1 years ago. Possible Duplicate: Javascript heredoc
This question already has answers here: Closed 1开发者_开发问答1 years ago.

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.


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();
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号