Which technique for conditional loading content?
<p>I am building a mobile-first approach website and am deciding on the best technique to conditionally load content. </p>

<p><strong>Technique 1</strong></p>

<p>This technique uses <a href="http://wicky.nillia.ms/enquire.js/" rel="nofollow">enquire.js</a></p>

<p>along with the following code...</p>

<pre><code>enquire
  .register("(min-width: 500px)", {
     match: function() {
        $("#page").load("content.html");
     }
  })
  .listen();
</code></pre>

<p>This solution relies on jQuery and Enquire.js. When page is resized upwards, the new content is downloaded automatically, and when resized downwards, the loaded content remains, and can be removed via display:none, although the code remains in the DOM once loaded. </p>

<p><strong>Technique 2</strong></p>

<p>This is the second <a href="http://css-tricks.com/examples/ConditionalCSS/" rel="nofollow">technique</a> </p>

<p>I have done a codepen of the second technique <a href="http://codepen.io/anon/pen/noqIk" rel="nofollow">here</a>, using alerts instead of actual content</p>

<p>This is based on CSS media queries, and seems to be a lot quicker than the first technique, and swaps content at breakpoint. No code is left in the DOM once resized, only the code for that viewport.</p>

<p>I am inclined to go with technique 2, but am not sure if this is the best technique for this. Which would you choose and why?</p>
