title: Add a link stylesheet dynamically in the <head>
body: <p>How to add a link stylesheet reference to the head of a document ?</p>
  
  <p>I've found this code but it's not working with all browsers, it crashes my IE7 :</p>
  
  <pre><code>var ss = document.createElement("link");
  ss.type = "text/css";
  ss.rel = "stylesheet";
  ss.href = "style.css";
  document.getElementsByTagName("head")[0].appendChild(ss);
  </code></pre>
  
  <p>Thanks</p>