In order to use jQuery, we need to include it in our project. To do this, follow these steps:
-
Inside the
scripts
folder in your assignment, add a new file calledjQuery.js
. -
In your browser, go to
http://jquery.com/download/
. There are a couple different versions of jQuery available to download. We are going to use the compressed, production version (not the slim build). -
Click on the link for the compressed, production version of jQuery. You will be brought to a page with a ton of code in it! You don't need to be able to read this code. In fact, it's compressed so that the file is small, but really hard to read. All you need to do is copy all of the code you see in your browser window.
-
Paste this code in your
jQuery.js
file in your project. Don't forget to save! -
Source this file in your HTML using a
<script>
tag. It needs to be sourced above your client.js file, or else it won't work correctly. Remember that this file is inside thescripts
folder!
Don't forget to reach out on Slack with your questions!