19-02-2013, 02:25 PM
jQuery Tutorial for Beginners: Nothing But the Goods
jQuery Tutorial.pdf (Size: 33.21 KB / Downloads: 40)
INTRODUCTION
long ago I wrote an article for Six Revisions called “Getting Started with jQuery” that covered some important
things (concept-wise) that beginning jQuery developers should know. This article is the complete opposite; there’s no
concepts, no principles, and very little lecturing -- just some straight example code with brief descriptions
demonstrating what you can do with jQuery.
This fast-paced tutorial should be able to get beginners up and running with jQuery very quickly, while also providing a
good overview of what jQuery is capable of (although jQuery’s capabilities go far beyond this beginning tutorial).
Keep in mind that this tutorial is just a bunch of straightforward, superficial code examples and very brief explanations
for beginners who want to avoid all the jargon and complexities. But I still highly recommend that all beginners get
past this stuff by means of a good book, some more in-depth tutorials online, or by using the jQuery documentation.
Link to jQuery's Source Code Remotely
This is an optional technique that many developers are using today. Instead of hosting the jQuery source code on
your own server, you can link to it remotely. This ensures the fastest possible download time of the source code, since
many users visiting your site might have the file already cached in their browser.
Running Code Unobtrusively When the DOM is Ready
The first thing you need to be up and running with jQuery is what’s called the “document ready” handler. Pretty much
everything you code in jQuery will be contained inside one of these. This accomplishes two things: First, it ensures
that the code does not run until the DOM is ready. This confirms that any elements being accessed are actually in
existence, so the script won’t return any errors. Second, this ensures that your code is unobtrusive. That is, it’s
separated from content (XHTML) and presentation (CSS).
This is Just the Beginning
There is so much more you can do with jQuery beyond these basics I've introduced here. I highly recommend that all
developers buy a good book on jQuery, and also take the time to learn some important JavaScript concepts (like
anonymous functions, closures, scope, etc.) in order to be able to use jQuery in a more powerful way.
And please note that I've introduced a lot of commands and syntaxes in a very superficial manner, without explaining
many of the problems you could have with some of these, so if you do run into problems, you can check out
the jQuery documentation.