Skip to content

Commit 06b6e7b

Browse files
githubshrekscottgonzalez
authored andcommitted
How jQuery Works: Be more explicit
Closes gh-511 Closes gh-512
1 parent 2cafec3 commit 06b6e7b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

page/about-jquery/how-jquery-works.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ $( document ).ready(function() {
6767
});
6868
```
6969

70-
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.
70+
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.
7171

7272
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:
7373

@@ -85,6 +85,8 @@ $( document ).ready(function() {
8585
});
8686
```
8787

88+
Try replacing your first snippet of jQuery code, which you previously copied in to your HTML file, with the one above. Save the HTML file again and reload to try it out.
89+
8890
### Complete Example
8991

9092
The following example illustrates the click handling code discussed above, embedded directly in the HTML `<body>`. Note that in practice, it is usually better to place your code in a separate JS file and load it on the page with a `<script>` element's `src` attribute.

0 commit comments

Comments
 (0)