diff --git a/page/using-jquery-core/document-ready.md b/page/using-jquery-core/document-ready.md index da379ebe..b2f83026 100644 --- a/page/using-jquery-core/document-ready.md +++ b/page/using-jquery-core/document-ready.md @@ -3,7 +3,7 @@ "level": "beginner" } -A page can't be manipulated safely until the document is "ready." jQuery detects this state of readiness for you. Code included inside `$( document ).ready()` will only run once the page Document Object Model (DOM) is ready for JavaScript code to execute. Code included inside `$( window ).load(function() { ... })` will run once the entire page (images or iframes), not just the DOM, is ready. +A page can't be manipulated safely until the document is "ready." jQuery detects this state of readiness for you. Code included inside `$( document ).ready()` will only run once the page Document Object Model (DOM) is ready for JavaScript code to execute. Code included inside `$( window ).on("load", function() { ... })` will run once the entire page (images or iframes), not just the DOM, is ready. ``` // A $( document ).ready() block. @@ -32,10 +32,10 @@ function readyFn( jQuery ) { $( document ).ready( readyFn ); // or: -$( window ).load( readyFn ); +$( window ).on("load", readyFn ); ``` -The example below shows `$( document ).ready()` and `$( window ).load()` in action. The code tries to load a website URL in an `