title: How can I shorten this javascript expression? document.createElement
body: <p>I would like to shorten this js code, you can?</p>
  
  <pre><code>&lt;script&gt;
      var h = document.getElementsByTagName('head')[0],
          s = document.createElement('script');
      s.type = 'text/javascript';
      s.src = 'file.js';
      h.appendChild(s);
  &lt;/script&gt;
  </code></pre>
  
  <p>I guess something like this but not work:</p>
  
  <pre><code>&lt;script&gt;
      var h = document.getElementsByTagName('head')[0],
          s = document.createElement('script').type='text/javascript';
      s.src = 'file.js';
      h.appendChild(s);
  &lt;/script&gt;
  </code></pre>