Difference between revisions of "MediaWiki:Chameleon.js"

From Cyberpunk 2077 Wiki
 
m (1 revision imported: Minimal content template stuff)
 
(One intermediate revision by one other user not shown)

Latest revision as of 00:53, 5 January 2021

docReady(function() {

});

function docReady(fn) {
    // see if DOM is already available
    if (document.readyState === 'complete' || document.readyState === 'interactive') {
        // call on next available tick
        setTimeout(fn, 1);
    } else {
        document.addEventListener('DOMContentLoaded', fn);
    }
}