From 2af1f59bcd4b9d8604f57132a4581c0bf9d9e66d Mon Sep 17 00:00:00 2001 From: "Henry C. Gernhardt, III" Date: Wed, 16 Nov 2016 07:46:57 -0500 Subject: [PATCH] Component: learn.jquery.com/using-jquery-core/document-ready Removes all references to the obsolete .load() method and replaces them with the appropriate .on( "load", function() { ... } ) reference. fixes #728 --- page/using-jquery-core/document-ready.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/page/using-jquery-core/document-ready.md b/page/using-jquery-core/document-ready.md index da379ebe..1b3428a9 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 `