clean up Ox.PATH
This commit is contained in:
parent
10a5481d47
commit
4d5291c340
1 changed files with 5 additions and 4 deletions
|
@ -90,11 +90,12 @@ Ox.SHORT_MONTHS = Ox.MONTHS.map(function(val) {
|
||||||
//@ Ox.PATH <str> Path of Ox.js
|
//@ Ox.PATH <str> Path of Ox.js
|
||||||
Ox.PATH = (function() {
|
Ox.PATH = (function() {
|
||||||
// IE8 can't apply slice to NodeLists, see Ox.slice
|
// IE8 can't apply slice to NodeLists, see Ox.slice
|
||||||
var index, scripts = document.getElementsByTagName('script');
|
var index, regexp = /Ox\.js(\?\d+|)$/,
|
||||||
|
scripts = document.getElementsByTagName('script'), src;
|
||||||
for (index = scripts.length - 1; index >= 0; index--) {
|
for (index = scripts.length - 1; index >= 0; index--) {
|
||||||
var src = scripts[index].src;
|
src = scripts[index].src;
|
||||||
if (/Ox\.js(\?\d+|)$/.test(src)) {
|
if (regexp.test(src)) {
|
||||||
return src.replace(/Ox\.js(\?\d+|)$/, '');
|
return src.replace(regexp, '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}());
|
}());
|
||||||
|
|
Loading…
Reference in a new issue