title: Generating HTML in JavaScript vs loading HTML file
body: <p>Currently I am creating a website which is completely JS driven. I don't use any HTML pages at all (except index page). Every query returns JSON and then I generate HTML inside JavaScript and insert into the DOM. Are there any disadvantages of doing this instead of creating HTML file with layout structure, then loading this file into the DOM and changing elements with new data from JSON?</p>
  
  <p>EDIT:
  All of my pages are loaded with AJAX calls. But I have a structure like this:</p>
  
  <pre><code>&lt;nav&gt;&lt;/nav&gt;
  &lt;div id="content"&gt;&lt;/div&gt;
  &lt;footer&gt;&lt;/footer&gt;
  </code></pre>
  
  <p>Basically, I never change <code>nav</code> or <code>footer</code> elements, they are only loaded once, when loading index.html file. Then on every page click I send an AJAX call to the server, it returns data in JSON and I generate HTML code with jQuery and insert like this <code>$('#content').html(content);</code> </p>
  
  <p>Creating separate HTML files, and then for example using <code>$('#someID').html(newContent)</code> to change every element with JSON data, will use even more code and I will need 1 more request to server to load this file, so I thought I could just generate it in browser.</p>
  
  <p>EDIT2:
  SEO is not very important, because my website requires logging in so I will create all meta tags in index.html file.</p>