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
document.addEventListener('DOMContentLoaded', function(initializeTextParser) {;
}
}
 
// Call the initializeTextParserOnLoad function when the entire page is loaded
window.onload = initializeTextParserOnLoad;
Cookies help us deliver our services. By using our services, you agree to our use of cookies.