<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Multiline Strings in JavaScript</title>
	<atom:link href="http://scriptnode.com/article/multiline-strings-in-javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://scriptnode.com/article/multiline-strings-in-javascript/</link>
	<description>Tips and tricks for web developers.</description>
	<lastBuildDate>Tue, 17 Aug 2010 14:15:22 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: diyism</title>
		<link>http://scriptnode.com/article/multiline-strings-in-javascript/comment-page-1/#comment-300</link>
		<dc:creator>diyism</dc:creator>
		<pubDate>Fri, 10 Jul 2009 08:05:15 +0000</pubDate>
		<guid isPermaLink="false">http://scriptnode.com/?p=217#comment-300</guid>
		<description>var ff_multi_str=function(){/*
&lt;form method=&quot;POST&quot;&gt;
&lt;textarea name=&quot;text&quot; style=&quot;width:420px;height:300px;vertical-align:top;&quot;&gt;hello&lt;/textarea&gt;
&lt;input type=&quot;submit&quot; value=&quot;Say&quot;&gt;
&lt;/form&gt;
*/}.toString().replace(/function\(\)\{\/\*/, &#039;&#039;).replace(/\*\/\}/, &#039;&#039;);
alert(ff_multi_str);

var ie_multi_str=&quot;&quot;+&lt;&gt;&lt;![CDATA[
&lt;form method=&quot;POST&quot;&gt;
&lt;textarea name=&quot;text&quot; style=&quot;width:420px;height:300px;vertical-align:top;&quot;&gt;hello&lt;/textarea&gt;
&lt;input type=&quot;submit&quot; value=&quot;Say&quot;&gt;
&lt;/form&gt;
]]&gt;&lt;/&gt;;
alert(ie_multi_str);</description>
		<content:encoded><![CDATA[<p>var ff_multi_str=function(){/*<br />
&lt;form method=&#8221;POST&#8221;&gt;<br />
&lt;textarea name=&#8221;text&#8221; style=&#8221;width:420px;height:300px;vertical-align:top;&#8221;&gt;hello&lt;/textarea&gt;<br />
&lt;input type=&#8221;submit&#8221; value=&#8221;Say&#8221;&gt;<br />
&lt;/form&gt;<br />
*/}.toString().replace(/function\(\)\{\/\*/, &#8221;).replace(/\*\/\}/, &#8221;);<br />
alert(ff_multi_str);</p>
<p>var ie_multi_str=&#8221;"+&lt;&gt;&lt;![CDATA[<br />
&lt;form method="POST"&gt;<br />
&lt;textarea name="text" style="width:420px;height:300px;vertical-align:top;"&gt;hello&lt;/textarea&gt;<br />
&lt;input type="submit" value="Say"&gt;<br />
&lt;/form&gt;<br />
]]&gt;&lt;/&gt;;<br />
alert(ie_multi_str);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: diyism</title>
		<link>http://scriptnode.com/article/multiline-strings-in-javascript/comment-page-1/#comment-299</link>
		<dc:creator>diyism</dc:creator>
		<pubDate>Fri, 10 Jul 2009 08:02:06 +0000</pubDate>
		<guid isPermaLink="false">http://scriptnode.com/?p=217#comment-299</guid>
		<description>var ff_multi_str=function(){/*
&lt;form method=&quot;POST&quot;&gt;
&lt;textarea name=&quot;text&quot; style=&quot;width:420px;height:300px;vertical-align:top;&quot;&gt;hello&lt;/textarea&gt;
&lt;input type=&quot;submit&quot; value=&quot;Say&quot;&gt;
&lt;/form&gt;
*/}.toString().replace(/function\(\)\{\/\*/, &#039;&#039;).replace(/\*\/\}/, &#039;&#039;);
alert(ff_multi_str);

/*var ie_multi_str=&#039;&#039;+&lt;&gt;&lt;![CDATA[
&lt;form method=&quot;POST&quot;&gt;
&lt;textarea name=&quot;text&quot; style=&quot;width:420px;height:300px;vertical-align:top;&quot;&gt;hello&lt;/textarea&gt;
&lt;input type=&quot;submit&quot; value=&quot;Say&quot;&gt;
&lt;/form&gt;
]]&gt;&lt;/&gt;;*/
alert(ie_multi_str);</description>
		<content:encoded><![CDATA[<p>var ff_multi_str=function(){/*<br />
&lt;form method=&#8221;POST&#8221;&gt;<br />
&lt;textarea name=&#8221;text&#8221; style=&#8221;width:420px;height:300px;vertical-align:top;&#8221;&gt;hello&lt;/textarea&gt;<br />
&lt;input type=&#8221;submit&#8221; value=&#8221;Say&#8221;&gt;<br />
&lt;/form&gt;<br />
*/}.toString().replace(/function\(\)\{\/\*/, &#8221;).replace(/\*\/\}/, &#8221;);<br />
alert(ff_multi_str);</p>
<p>/*var ie_multi_str=&#8221;+&lt;&gt;&lt;![CDATA[<br />
&lt;form method="POST"&gt;<br />
&lt;textarea name="text" style="width:420px;height:300px;vertical-align:top;"&gt;hello&lt;/textarea&gt;<br />
&lt;input type="submit" value="Say"&gt;<br />
&lt;/form&gt;<br />
]]&gt;&lt;/&gt;;*/<br />
alert(ie_multi_str);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Isaac Z. Schlueter</title>
		<link>http://scriptnode.com/article/multiline-strings-in-javascript/comment-page-1/#comment-222</link>
		<dc:creator>Isaac Z. Schlueter</dc:creator>
		<pubDate>Wed, 22 Oct 2008 06:21:43 +0000</pubDate>
		<guid isPermaLink="false">http://scriptnode.com/?p=217#comment-222</guid>
		<description>Escaping linebreaks is a pretty bad idea, imo.  If you have a trailing space after the \, then it&#039;s a syntax error.

These two methods work, too:

[&#039;this string&#039;,
&#039;spans multiple&#039;,
&#039;lines&#039;].join(&#039;\n&#039;);

&#039;this string\n&#039; +
&#039;spans multiple\n&#039; +
&#039;lines&#039;

The second one is better because the yuicompressor will be smart enough to squish it all into a single string literal, so you don&#039;t have the run-time overhead of the join operation.</description>
		<content:encoded><![CDATA[<p>Escaping linebreaks is a pretty bad idea, imo.  If you have a trailing space after the \, then it&#8217;s a syntax error.</p>
<p>These two methods work, too:</p>
<p>['this string',<br />
'spans multiple',<br />
'lines'].join(&#8217;\n&#8217;);</p>
<p>&#8216;this string\n&#8217; +<br />
&#8217;spans multiple\n&#8217; +<br />
&#8216;lines&#8217;</p>
<p>The second one is better because the yuicompressor will be smart enough to squish it all into a single string literal, so you don&#8217;t have the run-time overhead of the join operation.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
