2016-04-29 11 views
0

javascriptファイルをpastebin.com/rawやdl.dropboxusercontent.comなどのソースからjavascriptファイルにインポートする方法を知りたかったのですが、 @import ""と似たソリューションについて話しています。 CSSで。javascriptファイルをjavascriptファイルにインポートします。

私はとにかくHTMLを邪魔するつもりはないよ(例)

<script src="http://pastebin.com/raw/xxxxxx"> 
+1

[ファイル別のJavaScriptのJavaScriptファイルをインクルード?]の可能な重複(http://stackoverflow.com/質問/ 950087/include-a-javascript-file-in-another-javascript-file) –

答えて

0
var firstScript = document.getElementsByTagName('script')[0], 
js = document.createElement('script'); 
js.src = 'https://pastebin.com/raw/xxxxx'; 
firstScript.parentNode.insertBefore(js, firstScript); 
関連する問題