开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜