diff --git a/source/Ox.js b/source/Ox.js index 10bb8e2c..1725635d 100644 --- a/source/Ox.js +++ b/source/Ox.js @@ -10,7 +10,7 @@ callback = args[args.length - 1], path = getPath(), regexp = /dev\/$/, - time = +new Date(); + version; if (args[0] === true && regexp.test(path)) { path = path.replace(regexp, 'build/'); @@ -22,6 +22,7 @@ } else { loadJSON(function(data) { var previousOx = global.Ox; + version = data.version; loadScriptsSerial(data.files, function() { Ox.LOCALES = data.locales; Ox.VERSION = data.version; @@ -47,7 +48,8 @@ } function loadJSON(callback) { - var request = new XMLHttpRequest(); + var request = new XMLHttpRequest(), + time = +new Date(); request.open('GET', path + 'Ox/json/Ox.json?' + time, true); request.onreadystatechange = function() { if (request.readyState == 4) { @@ -73,7 +75,7 @@ callback(); } } - element.src = path + script + '?' + time; + element.src = path + script + '?' + version; element.type = 'text/javascript'; head.appendChild(element); }