title: Dynamically add script tag with src that may include document.write
body: <p>I want to dynamically include a script tag in a webpage however I have no control of it's src so src=&quot;source.js&quot; may look like this.</p>
  <pre><code>document.write('&lt;script type=&quot;text/javascript&quot;&gt;')
  document.write('alert(&quot;hello world&quot;)')
  document.write('&lt;/script&gt;')
  document.write('&lt;p&gt;goodbye world&lt;/p&gt;')
  </code></pre>
  <p>Now ordinarily putting</p>
  <pre><code>&lt;script type=&quot;text/javascript&quot; src=&quot;source.js&quot;&gt;&lt;/script&gt;
  </code></pre>
  <p>In the head works fine but is there any other way I can add <code>source.js</code> dynamically using something like <code>innerHTML</code>?</p>
  <p><a href="http://jsfiddle.net/PRNnm/" rel="noreferrer">jsfiddle of what i've tried</a></p>