diff --git a/_posts/en/2016-02-15-detect-document-ready-in-pure-js.md b/_posts/en/2016-02-15-detect-document-ready-in-pure-js.md index 9849093d..c5ed7efd 100644 --- a/_posts/en/2016-02-15-detect-document-ready-in-pure-js.md +++ b/_posts/en/2016-02-15-detect-document-ready-in-pure-js.md @@ -25,9 +25,9 @@ You can detect when the document it's ready... ```js let stateCheck = setInterval(() => { if (document.readyState === 'complete') { - clearInterval(stateCheck); - // document ready - } + clearInterval(stateCheck); + // document ready + } }, 100); ``` @@ -36,9 +36,9 @@ or with [onreadystatechange](https://developer.mozilla.org/en-US/docs/Web/Events ```js document.onreadystatechange = () => { - if (document.readyState === 'complete') { - // document ready - } + if (document.readyState === 'complete') { + // document ready + } }; ```