title: Why does chrome throw "Uncaught Error: NOT_FOUND_ERR: DOM Exception 8" here?
body: <p>Below is the code for my YWA wrapper</p>
  
  <pre><code>var astr_ywascript = (document.createElement("script").type = "text/javascript").src = "http://d.yimg.com/mi/eu/ywa.js";
  document.head.appendChild(astr_ywascript); // &lt;- error on this line
  </code></pre>
  
  <p>It's run on page load, so it makes no sense that JS can't find the document head tag.</p>
  
  <p>Any ideas?</p>
  
  <p>Thanks</p>
  
  <hr>
  
  <p>Opera throws this error on the same line. <code>Uncaught exception: Error: WRONG_ARGUMENTS_ER</code>
  Firebug says: <code>document.head is undefined [Break On This Error] document.head.appendChild(astr_ywascript);</code></p>