Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
If that's the case, then you can use jQuery here and then pass the dollar sign as an argument here. And then once you're in your anonymous function you can start doing stuff with the dollar sign again and it will work fine, you won't have to spell out jQuery every time. So just to show that this actually works, I am going to restore the original syntax and then we're going to use console.log to pass a message into the console. Now let's load this in a browser and see if it works. Okay, so here we are in Chrome. I'm going to reload this, to make sure I have the latest copy. Open up my console using command+option+i, and there we are.
Message for you sir, great. So when you're getting set to use jQuery, use this syntax to make sure that your DOM is loaded. And everything else will be taken care of for you.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 103188 Viewers
58 Video lessons · 55809 Viewers
61 Video lessons · 89883 Viewers
56 Video lessons · 105043 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.