title: Performance Comparison of HTML Added via Javascript vs. Normal HTML Markup
body: <p>Has anyone ever tested, or does anyone know, the performance differences of these two different ways of rendering the same html content (other than the fact that one has imported the jquery library and the other hasn't, and that there are two requests in the Ajax version versus one)?</p>
  
  <p><strong>Add HTML via Ajax</strong></p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;script src="javascripts/jquery.js" type="text/javascript"&gt;&lt;/script&gt;
  
      &lt;script type="text/javascript"&gt;
      jQuery.ajax({
          type: "GET",
          url: "http://www.mysite.com/events",
          success: function(result) {
              $("#container").append(result);
          }
      });
      &lt;/script&gt;
  
      &lt;body&gt;
          &lt;div id="container"&gt;
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>Inline HTML</strong></p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;body&gt;
          &lt;div id="container"&gt;
              &lt;!-- events --&gt;
              &lt;ol&gt;
                  &lt;li&gt;
                      &lt;p&gt;
                          Event A...
                      &lt;/p&gt;
                  &lt;/li&gt;
              &lt;/ol&gt;
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>What are the statistics on this, when would you and wouldn't you use something like this?  How much slower is the Ajax version (say, if I were to render something as complex as the Amazon homepage, assuming I didn't have to worry about paths, since this would be my own app)?  This question is independent of best practices for readability and all that, just wondering about performance.</p>