Day 2: Rehashing jQuery Basics

jQuery_badge

So today I went over jQuery basics, documentation and a total disruption of what I learned on Free Code Camp and Codecademy.

At both Free Code Camp and Codecademy I learned to write:

[code language=”javascript”]$(document).ready[/code]

before all the other code to help load the DOM before the rest of the page gets loaded. Without that, the wisdom was, some of your code wouldn’t load first, animations, etc would break because they were loaded a little down further in your js document.

But throughout Treehouse courses we always put the script tags at the end of the HTML document, right before the end

<body>

tag. This loads the document first before any JavaScript or jQuery.

So imagine my surprise when we were writing:

[code language=”javascript”]$(“.warning”).hide().show(“slow”);[/code]

without the

[code language=”javascript”]$(document).ready[/code]

at the top of the document.

Basically it was all videos. I’ll post more tomorrow as I do it. Excited about my progress.

Comments