javascript breaks when spaces are set within it
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/508269/how-do-i-break-a-string-across-more-than-one-line-of-code-in-javascript">How do I break a string across more than one line of code in JavaScript?</a>  </p>
</blockquote>



<p>Hi i am new to javascript and i struggling to get this to work.</p>

<p>Basically everything works fine, but as soon as there are any spaces within it, it breaks.</p>

<p>Its pulling from the database a text string, which is fine until there is a space like as follows:</p>

<pre><code>var getHtml = '&lt;div class="counterwrap"&gt;&lt;div class="countertitle"&gt;&lt;h1&gt;&lt;?php echo $ublunderconstructioninfo-&gt;title ; ?&gt;&lt;/h1&gt;&lt;/div&gt;&lt;div class="counter"&gt;&lt;div class="counternumbers"&gt;&lt;div id="counterdays"&gt;&lt;/div&gt;&lt;p&gt;Days&lt;/p&gt;&lt;/div&gt;&lt;div class="counternumbers"&gt;&lt;div id="counterhours"&gt;&lt;/div&gt;&lt;p&gt;Hours&lt;/p&gt;&lt;/div&gt;&lt;div class="counternumbers"&gt;&lt;div id="counterminutes"&gt;&lt;/div&gt;&lt;p&gt;Minutes&lt;/p&gt;&lt;/div&gt;&lt;div class="counternumberslast"&gt;&lt;div id="counterseconds"&gt;&lt;/div&gt;&lt;p&gt;Seconds&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="countertext"&gt;this is where some text goes&lt;/div&gt;&lt;/div&gt;';
            $("body").html(getHtml);
</code></pre>

<p>Now if there is a space like this, then then it breaks:</p>

<pre><code>    var getHtml = '&lt;div class="counterwrap"&gt;&lt;div class="countertitle"&gt;&lt;h1&gt;&lt;?php echo $ublunderconstructioninfo-&gt;title ; ?&gt;&lt;/h1&gt;&lt;/div&gt;&lt;div class="counter"&gt;&lt;div class="counternumbers"&gt;&lt;div id="counterdays"&gt;&lt;/div&gt;&lt;p&gt;Days&lt;/p&gt;&lt;/div&gt;&lt;div class="counternumbers"&gt;&lt;div id="counterhours"&gt;&lt;/div&gt;&lt;p&gt;Hours&lt;/p&gt;&lt;/div&gt;&lt;div class="counternumbers"&gt;&lt;div id="counterminutes"&gt;&lt;/div&gt;&lt;p&gt;Minutes&lt;/p&gt;&lt;/div&gt;&lt;div class="counternumberslast"&gt;&lt;div id="counterseconds"&gt;&lt;/div&gt;&lt;p&gt;Seconds&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="countertext"&gt;this is where some text goes

but when there is a linebreak

like this it breaks
&lt;/div&gt;&lt;/div&gt;';
            $("body").html(getHtml);
</code></pre>
