title: Is it better to do raw data to HTML processing serverside or clientside?
body: <p>I currently have a setup that works like this:</p>
  
  <p><strong>Serverside:</strong></p>
  
  <ol>
  <li><p>Retrieve data from MySQL </p></li>
  <li><p>Run the data through a loop that generates HTML. For example:</p></li>
  </ol>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div&gt;
      Item 1:&lt;br&gt;
          Color: Red, Amount: 8, Cost: $15 each
      Item 2:&lt;br&gt;
          [...]
      [...]
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>Clientside:</strong></p>
  
  <p>Update a div's HTML with the received data: <code>$("#details").html(result);</code></p>
  
  <p>Would it be better to do something like this:</p>
  
  <p><strong>Serverside:</strong></p>
  
  <ol>
  <li><p>Retrieve data from MySQL</p></li>
  <li><p>Run the data through a loop that generates a JSON object. For example:</p></li>
  </ol>
  
  <pre class="lang-javascript prettyprint-override"><code>{"result":
      "0":[{"Color":"Red"},{"Amount":"8"},{"Cost":"15"}], 
      "1":[...]
      [...]
  }   
  </code></pre>
  
  <p><strong>Clientside:</strong></p>
  
  <p>Parse into HTML and update the div with the parsed HTML. All the data delivered will be used somehow, and the end result will be exactly the same as if it were parsed serverside. The JSON object will be discarded once the function is done running.</p>