title: Is building big portions of page in javascript bad?
body: <p>On an existing project I am working on, I noticed many of the developers are building big portions of pages with javascript. For example:</p>
  
  <pre><code>$( targetdiv ).append("&lt;div&gt;");
  $( targetdiv ).append("   &lt;div class='info'&gt;");      
  $( targetdiv ).append("        &lt;div id='modes'&gt;");
  $( targetdiv ).append("          &lt;table cellspacing='0'&gt;");
  $( targetdiv ).append("            &lt;tbody&gt;");
  // much more...
  </code></pre>
  
  <p>I understand using javascript to build <strong>certain</strong> elements on page. Sometimes the content is dynamic and it is now know when the page first loads (ajax stuff).</p>
  
  <p>However, most of the code (not all is shown) is not dynamic and will be build the same way every time. No 'if' statements or loops </p>
  
  <p><strong>Is there any reason why one would build large parts of pages using javascript vs just having the html be part of the html doc?</strong> I would think one would want to minimize javascript html generation because its more confusing and harder to write. Also, javascript html generation has to hurt the performance (<strong>Does it?</strong>) </p>
  
  <p>I am a "newer" javascript dev so maybe I am missing something. I want to say something but I am "newer" so maybe i don't get "it"</p>
  
  <p>Thanks</p>