title: Random CSS file loading - not working in IE8 (7?)
body: <p>I'm loading a CSS file dynamically using a little bit of randomization:</p>
  
  <pre><code> var cookie = $.cookie('necgroupcolour', { path: '/' });
  
      if (cookie == null) {
          var rnd = Math.floor(Math.random() * 3);
  
          $.cookie('necgroupcolour', rnd, { path: '/' });
      }
  
      switch ($.cookie('necgroupcolour', { path: '/' })) {
          case "0":
              $('head').append('&lt;link rel="stylesheet" type="text/css" href="/css/purple/HomeMaster.css" /&gt;');
              break;
  
          case "1":
              $('head').append('&lt;link rel="stylesheet" type="text/css" href="/css/blue/HomeMaster.css" /&gt;');
              break;
  
          case "2":
              $('head').append('&lt;link rel="stylesheet" type="text/css" href="/css/green/HomeMaster.css" /&gt;');
              break;
  
          default:
              $('head').append('&lt;link rel="stylesheet" type="text/css" href="/css/purple/HomeMaster.css" /&gt;');
      }
  </code></pre>
  
  <p>This works fine in Firefox, Safari, Chrome, but not in IE8 or lower.</p>
  
  <p>When running this through Fiddler and checking the source you can see that no CSS file is getting loaded.</p>
  
  <p>Any ideas how I could solve this?</p>