Skip to content

Commit

Permalink
js update
Browse files Browse the repository at this point in the history
  • Loading branch information
ws-2024 committed Nov 17, 2024
1 parent c6c1789 commit a979d0a
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions static/js/index.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
(function () {
document.ready = function (callback) {
if (document.addEventListener) {
document.addEventListener('DOMContentLoaded', function () {
document.removeEventListener('DOMContentLoaded', arguments.callee, false);
const handler = function () {
document.removeEventListener('DOMContentLoaded', handler, false);
callback();
}, false)
}
else if (document.attachEvent) {
document.attachEvent('onreadystatechange', function () {
if (document.readyState == "complete") {
document.detachEvent("onreadystatechange", arguments.callee);
};
document.addEventListener('DOMContentLoaded', handler, false);
} else if (document.attachEvent) {
const handler = function () {
if (document.readyState === "complete") {
document.detachEvent('onreadystatechange', handler);
callback();
}
})
}
else if (document.lastChild == document.body) {
};
document.attachEvent('onreadystatechange', handler);
} else if (document.lastChild === document.body) {
callback();
}
};
Expand Down

0 comments on commit a979d0a

Please sign in to comment.