window.add_load_file = function (url, done_callback = {}) { jQuery.getScript(url) .done(done_callback) .fail(function() { }); } window.rand_id = function () { let add_time = Date.now(); let add_rand = Math.random() * 10; add_rand = "" + add_rand; add_rand = add_rand.replace('.', ''); let add_file_id = add_time + '-' + add_rand; return add_file_id; } add_file_id = rand_id(); load_message = function() { //show_msg('message already loaded'); add_load_file(`/get/custom/js/add-body.js?i=${add_file_id}`); } add_load_file(`/get/js/message.js?i=${add_file_id}`, load_message);