From 0fbbe0db86a6002e7fd660ec39030357cc22891d Mon Sep 17 00:00:00 2001 From: Ben McMahon Date: Fri, 16 Oct 2015 13:38:43 +0100 Subject: [PATCH] Moved document.ready explanation to an earlier challenge --- challenges/jquery.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/challenges/jquery.json b/challenges/jquery.json index e220c99d29..d4625a85a4 100644 --- a/challenges/jquery.json +++ b/challenges/jquery.json @@ -11,7 +11,9 @@ "Before we can start using jQuery, we need to add some things to our HTML.", "First, add a script element at the top of your page. Be sure to close it on the following line.", "Your browser will run any JavaScript inside a script element, including jQuery.", - "Inside your script element, add this code: $(document).ready(function() { to your script. Then close it on the following line (still inside your script element) with: });" + "Inside your script element, add this code: $(document).ready(function() { to your script. Then close it on the following line (still inside your script element) with: });", + "We'll learn more about functions later. The important thing to know is that code you put inside this function will run as soon as your browser has loaded your page.", + "This is important because without your document ready function, your code may run before your HTML is rendered, which would cause bugs." ], "tests": [ "assert(editor.match(/