fix load on IE and Firefox 3.6

This commit is contained in:
j 2012-07-05 19:05:52 +02:00
parent bda90f6b6b
commit 762d5ca963
2 changed files with 3 additions and 2 deletions

View file

@ -240,7 +240,7 @@ Ox.load(/^https?:\/\/(www\.)?oxjs\.org\//.test(
}, },
loadData: function(callback) { loadData: function(callback) {
var q = '?' + Ox.random(1000000), var q = '?' + Ox.random(1000000),
url = 'https://oxjs.org/downloads/downloads.json' + q; url = '//oxjs.org/downloads/downloads.json' + q;
Ox.getJSON('index.json' + q, function(data) { Ox.getJSON('index.json' + q, function(data) {
app.data = Ox.extend(app.data, data); app.data = Ox.extend(app.data, data);
app.data.pages.forEach(function(page) { app.data.pages.forEach(function(page) {

View file

@ -322,11 +322,12 @@ Ox.documentReady <function> Calls a callback function once the DOM is ready
@*/ @*/
Ox.documentReady = (function() { Ox.documentReady = (function() {
var callbacks = []; var callbacks = [];
document.onreadystatechange = function() { document.onreadystatechange = window.onload = function() {
if (document.readyState == 'complete') { if (document.readyState == 'complete') {
callbacks.forEach(function(callback) { callbacks.forEach(function(callback) {
callback(); callback();
}); });
document.onreadystatechange = window.onload = null;
} }
}; };
return function(callback) { return function(callback) {