Getting My Feet Wet With jQuery
Posted by admin | Filed under Code, JavaScript, jQuery
For those that are not familiar - jQuery is “a new type of JavaScript library.”
For some time now, I’ve been reading and hearing about how great jQuery is and how I need to learn it. And so, yesterday I officially downloaded the current release (1.2.3) and started playing with it. Naturally, considering the fact that I am not crazy versed with JavaScript (I only know the basics), I started with the first tutorial on the jQuery website - you know, just to get my feet wet.
I must say, I had fun!
The first tutorial, also called “How jQuery Works” by John Resig himself, was a great introduction. Even though a lot of it I’ve already heard of or seen in use, I read every word. Building a solid base is essential, and so I wanted to make sure I got a good solid understanding of the bare basics.
From the introduction, I learned the proper way of launching the code on (document).ready instead of window.onload. The reason behind this is quite simple. By using window.onload, the code does not execute until all of the elements on the page are downloaded, which includes images, banners, etc. With (document).ready the code gets executed as soon as the document is - well, ready. What that means is that as soon as all of the HTML is loaded into our document, or in other words, as soon as the HTML tag closes, the JavaScript is executed. The beauty of this is that there is no waiting for all the elements on the page to fully download.
The other thing that makes jQuery really awesome is it’s CSS implementation. Finding this out got me pretty excited as - CSS I know; and so, this part of jQuery makes total sense. It makes it really simple to target an element. It allows you to addClass or removeClass from an element. Better yet, jQuery not only lets you pass CSS selectors, but also works marvelously with pseudo-classes!
There’s also a good amount of built in events that make the code simpler and concise. The whole list and a bunch of other options can be found in the jQuery documentation. The best part is that all of these events and methods can be chained together, which shortens the code even more. For those a bit more advanced or eager to experiment, please check out this list of 37 More Shocking jQuery Plugins. I came across that just yesterday, and it’s partly what officially inspired me to dabble into jQuery myself.
Consisting of just one, single JavaScript file, jQuery is quite an amazing library. That’s right. All of this in just one file, and I am just touching the surface. However, don’t be fooled! It is anything, but simple. The single file contains massive amounts of goodness and everything you need to get started and rolling, and well beyond with JavaScript.
∂meow
Tags: JavaScript, jQuery
CSS Naked Day
Posted by admin | Filed under CSS, Code, Design, Fun
It’s here - April 9th - the Third Annual CSS Naked Day!
So, what is CSS Naked day and why does my blog look so naked?
CSS Naked Day is a tribute to the beauty of CSS and a propaganda for web standards. For one day, the participants simply remove the stylesheet of the website or blog - the result is a naked HTML site.
For more information and participation visit: Dustin Diaz Naked Day website.
∂meow
Tags: CSS, dustin diaz, naked day