Last active
September 18, 2016 07:26
-
-
Save amuhororo/5ff0fc5b7dd6eb316bd6cf56a57bdc6c to your computer and use it in GitHub Desktop.
シナリオファイルのキャッシュ+ver管理
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.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