From 9fe7dca52ca027b27719cfb20a6070df4031b203 Mon Sep 17 00:00:00 2001 From: githubshrek Date: Fri, 20 Jun 2014 14:40:40 +0200 Subject: [PATCH] Update how-jquery-works.md I'm a complete newbie here (i.e. your audience), so I although I guessed I was supposed to put the jQuery snippet somewhere, I wasn't clear where. Was I supposed to put it in the jquery.js which I had just downloaded? Or in the HTML file somewhere? I wasn't sure. Eventually I figured out it belonged in the HTML file where it was written "// Your code goes here' (and felt stupid for not realising that). Anyway, I recommend making these instructions even more explicit. --- page/about-jquery/how-jquery-works.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/page/about-jquery/how-jquery-works.md b/page/about-jquery/how-jquery-works.md index 5b8dfa00..4a72b0e0 100644 --- a/page/about-jquery/how-jquery-works.md +++ b/page/about-jquery/how-jquery-works.md @@ -65,7 +65,7 @@ $( document ).ready(function() { }); ``` -Save your HTML file and reload the test page in your browser. Clicking the link should now first display an alert pop-up, then continue with the default behavior of navigating to http://jquery.com. +Copy the above jQuery code into your HTML file where it says '// Your code goes here'. Then, save your HTML file and reload the test page in your browser. Clicking the link should now first display an alert pop-up, then continue with the default behavior of navigating to http://jquery.com. For `click` and most other [events](http://api.jquery.com/category/events/), you can prevent the default behavior by calling `event.preventDefault()` in the event handler: