Trying to use the Heredoc Method described here:
http://www.developfortheweb.com/2009/03/multi-line-strings-in-javascript/
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();
I can't make it work on node.js. I tested it on client side - it works on Firefox, but Chrome.
How should I use this method on node.js?
Thanks!
Even though this blog posts tells you something else, JavaScript does not have heredoc strings.
So you should not use it at all - it is a dirty hack. The reason why it works in some browsers is that they allow inline XML. NodeJS probably doesn't because well, it's ugly and dirty.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With