add Ox.Log, determine Ox.PATH by looking at the _last_ Ox.js script
This commit is contained in:
parent
1954a7a799
commit
116d0bfdbf
4 changed files with 23 additions and 5 deletions
|
|
@ -27,12 +27,13 @@ Ox = {
|
|||
});
|
||||
|
||||
function getPath() {
|
||||
var i, scripts = document.getElementsByTagName('script');
|
||||
var i, path, scripts = document.getElementsByTagName('script');
|
||||
for (i = 0; i < scripts.length; i++) {
|
||||
if (/Ox\.js$/.test(scripts[i].src)) {
|
||||
return scripts[i].src.replace(/Ox\.js$/, '');
|
||||
path = scripts[i].src.replace(/Ox\.js$/, '');
|
||||
}
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
function loadJSON(callback) {
|
||||
|
|
@ -82,7 +83,7 @@ Ox = {
|
|||
element.onload = callback;
|
||||
element.src = path + script + '?' + parseInt(Math.random() * 1000000);
|
||||
element.type = 'text/javascript';
|
||||
document.getElementsByTagName('head')[0].appendChild(element);
|
||||
document.head.appendChild(element);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue