MediaWiki:Common.js: Difference between revisions
From Emmy The Robot Fandom Wiki
Content added Content deleted
No edit summary |
No edit summary |
||
Line 39: | Line 39: | ||
// Call the initializeTextParser function when the DOM is ready |
// Call the initializeTextParser function when the DOM is ready |
||
function initializeTextParserOnLoad() { |
|||
⚫ | |||
if (document.readyState === "complete" || (document.readyState !== "loading" && !document.documentElement.doScroll)) { |
|||
⚫ | |||
// The DOM has already loaded, so call initializeTextParser immediately |
|||
}); |
|||
⚫ | |||
} else { |
|||
// Wait for the DOMContentLoaded event to call initializeTextParser |
|||
⚫ | |||
} |
|||
} |
|||
// Call the initializeTextParserOnLoad function when the entire page is loaded |
|||
window.onload = initializeTextParserOnLoad; |