function checkLoaded() { return document.readyState === "complete" || document.readyState === "interactive"; } console.log(checkLoaded()) // true or false