Try to understand everything she covers in that guide because it’s all … fundamental … haha.
I liked this recommendation of theirs:
// bad var sidebar = $('.sidebar'); // good var $sidebar = $('.sidebar');
because, yeah, totally, if you’re caching a jQuery object why not prefix it with a dollar sign so you remember that’s what it is? There’s a lot of good stuff like that.
This is a funny video about jQuery: Paul Irish : 10 Things I Learned from the jQuery Source. I mean it’s insightful too. It’s just this guy reading the source code and explaining how jQuery works. It makes you feel like you could just read and understand the source code of any major library or framework.
The next thing to do is try making some static sites with jQuery and maybe put them on GitHub Pages. Just create a repo and do your work on a branch called
gh-pages. You can just delete your master branch. When you’re ready to show off your work you can push it to GitHub and people can look at the actual site as well as the source code. It’s really cool, this becomes this just because of the branch name. Btw the location of the page is always
Some things to make:
- a calculator
- a todo list
- a page that pulls in JSON data from some API and renders it on a page. maybe make a page where you can enter a github handle and it will fetch the JSON at, eg,
https://github.com/maxjacobson.jsonand print some of the data to the page. Or any other API. Maybe one from a web app you made.
Maybe also install node. Just
console.log wherever you would use
puts in Ruby.
sudo npm install -g coffee-script (npm is “node package manager” and it’s a lot like RubyGems. The main difference is that by default, without the
coffee -c whatever.coffee which will create
whatever.js for you.
CoffeeScript is kind of confusing at first but I really like it. It’s like, why use this. It took me a while to figure out how to use CoffeeScript with jQuery but it’s actually super simple, here’s a basic example:
$(document).ready -> $("#shout").on "click", -> alert "YO WHAT UP"
Which could be written even more compactly as:
$ -> $("#shout").on "click", -> alert "YO WHAT UP"
Which is kind of ridiculous and unreadable but cool that it’s valid?
I guess all that’s left is to keep going and start learning how to build complicated software in this cool language. I want to learn a JS framework next and can’t figure out where to start. But that… is a tale for another blog post.