title: How to include a JavaScript file when the screen is a certain size?
body: <p>I want to include a file such as foo.js, only when the screen is a certain size.</p>
  
  <p><strong>For example:</strong> </p>
  
  <pre><code>&lt;script&gt;
  if (screen.width &lt;= 960)
  {
      document.write('\x3Cscript type="text/javascript" src="/foo.js"&gt;\x3C/script&gt;'); 
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>Any ideas?</p>