Skip to content

Instantly share code, notes, and snippets.

@amuhororo
Last active September 18, 2016 07:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amuhororo/5ff0fc5b7dd6eb316bd6cf56a57bdc6c to your computer and use it in GitHub Desktop.
Save amuhororo/5ff0fc5b7dd6eb316bd6cf56a57bdc6c to your computer and use it in GitHub Desktop.
シナリオファイルのキャッシュ+ver管理
$.loadText = function(file_path, callback) {
game_ver = "1.00"; //小数点以下の0も表記したいので文字列
$.ajax({
//url: file_path + "?" + Math.floor(Math.random() * 1000000),
url: file_path + "?" + game_ver,
cache: true,
success: function(text){
order_str = text;
callback(order_str);
},
error:function(){
alert("file not found:"+file_path);
callback("");
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment