ウェブページにスクリプトタグを動的に含めることはできますが、srcを制御できないので、src = "source.js"は次のようになります。srcでdocument.writeを含むスクリプトタグを動的に追加します。
document.write('<script type="text/javascript">')
document.write('alert("hello world")')
document.write('</script>')
document.write('<p>goodbye world</p>')
さて、通常の頭の中で
<script type="text/javascript" src="source.js"></script>
を置くことは、正常に動作しますが、私は動的にinnerHTMLのようなものを使用してsource.jsを追加することができ、他の方法はありますか?
ポストスクライブの苦労の時間は解決策です! [https://github.com/krux/postscribe/](https://github.com/krux/postscribe/) –
[asyncは、document.writeを使用してJavaScriptをロードしています](http://stackoverflow.com/)質問/ 13003644/async-loading-javascript-with-document-write) –