From 2b2e8c8ef2d1e6b861b01806d034e1cebccd640a Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Wed, 22 Jan 2014 10:15:29 +0000 Subject: [PATCH] load Ox.js debug version with ?version --- source/Ox.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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); }