load Ox.js debug version with ?version

This commit is contained in:
j 2014-01-22 10:15:29 +00:00
parent 9a67924916
commit 2b2e8c8ef2

View file

@ -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);
}