JavaScriptファイルをテキストファイルとして読み取り、コードが複数回実行されるのを防ぐ方法
index.js
version = "1.001";
alert("JS run");
... other code ...
index.js を使用する html を使用して index.js
を読み込もうとしています
jQuery.get("js/index.js",function(data){
var currentVersion = data.split("\n")[0].split('"')[1];
}
好きなようにテキストを読むことができますが、このコードを使用した後、alert("JS run") および内部の他のコードも実行されます。