title: document.head.appendChild(element) ie ie7 and ie8
body: <p>i am having an issue appending a script to the head in ie7/8</p>
  
  <p>this is the code i am using</p>
  
  <pre><code>var requireTag = document.createElement('script');
  requireTag.setAttribute('type',         'text/javascript');
  requireTag.setAttribute('src',          link+ 'require.js');
  requireTag.setAttribute('data-main',    link+ 'data');
  
  document.head.appendChild(requireTag);
  </code></pre>
  
  <p>this is the error i get</p>
  
  <pre><code>SCRIPT5007: Unable to get value of the property
  'appendChild': object is null or undefined  
  </code></pre>
  
  <p>I found this <a href="https://stackoverflow.com/questions/6957249/createelement-error-in-ie8">createElement error in IE8</a> and tried updating my code to have</p>
  
  <pre><code>var appendChild = document.head.appendChild(requireTag);
  </code></pre>
  
  <p>but still get the same error. Can anyone help?</p>