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