Difference between revisions of "MediaWiki:Chameleon.js"

From Far Cry 6 Wiki
(Created page with "docReady(function() { }); function docReady(fn) { // see if DOM is already available if (document.readyState === 'complete' || document.readyState === 'interactive')...")
m (1 revision imported: Minimal content template stuff)
 
(No difference)

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);
    }
}