title: How can I use JavaScript/jQuery to conditionally add a stylesheet?
body: <p>I've looked online for a suitable solution to the following issue and I can't seem to find a useful workaround;</p>
  
  <p>We're using Umbraco CMS to display a client's website, this isn't allowing us to add in the usual conditional comments that one would do in the <strong>&lt; head ></strong> of the HTML. Therefore I've been trying to find a way to get JavaScript or jQuery to <em>conditionally</em> display an IE9 specific stylesheet.</p>
  
  <p>The options I've seen so far are as follows:</p>
  
  <pre><code>if ($.browser.msie &amp;&amp; parseInt($.browser.version, 10) === 7) {
      $('head').append('&lt;link&gt;', {
          rel:  'stylesheet',
          type: 'text/css',
          href: 'css/ie9.css'
      });
  }
  </code></pre>
  
  <p>And using <strong>conditionizr</strong> (which hasn't worked due to a console error on the ".add" function).</p>
  
  <p>Any ideas on this?</p>