JQuery: Javascript for CSS Lovers

Tim Searles
With Web 2.0 in most websites nowadays you need a powerful Javascript library to make websites not only dynamic but easy to program with. Javascript is being used to drive animation and certain effects that the Flash world was once king over. I don't see Flash ever dying per se, but its advantages are becoming fewer and fewer as people move from the world that needs plugins to a world that just needs an extra line of code.

I remember when I was first introduced to Javascript I didn't like it. I thought it was too convoluted and it just didn't make much sense. I didn't see the benefits of what it could do or how it could really help websites so I stayed away from it like the plague and preferred scripting languages such as PHP and ASP. In the last couple of years there has been an influx of the awareness of scripting libraries such that the world of front-end web development is no longer just HTML and CSS, but to be effective you must include a Javascript arsenal as well... for me, that arsenal includes JQuery.

There are about three reasons why I love JQuery over other Javascript libraries:

1. If you know CSS, you can do JQuery...

JQuery, in my opinion, was written for CSS lovers. The syntax basically looks like this:

$('#id').width()

$('.class ul li').height();

$('span > a').show();

This is nothing more than typical CSS structure. As CSS grows, so will JQuery. Most other libraries have their own way of grabbing an element or a group of elements, but JQuery makes it easy for you by taking already existing CSS structure.

2. If you need an effect 90% of the time some other developer has already written it in JQuery...

I've worked with JQuery, Prototype, and MooTools... it seems in recent experience that whenever I've needed something done in Javascript, someone has already done it using JQuery. I'm an advocate of not reinventing the wheel so if I see that someone else has already done an application for a feature that I need, and it's widely available, I don't mind giving that developer a credit on a site I work on. If it can save me a few hours and a few headaches, I'll happily oblige with your request.

3. The widgets are great.

If you go to jqueryui.com you'll find widgets like the datepicker. You know, that widget that you find on airline sites, or anywhere that requires you to make an appointment, sort items by date, etc. A custom progress bar, a basic dialog box, an accordion feature for opening and closing certain blocks of content... and one of my favorite... tabs! Anyone who has done front-end development knows how challenging it can be to develop tabs cross-browser, especially for IE6 if you have transparent images.

The available functions are straightforward, the widgets are cool, and I picked up the language very quickly. That's enough reason for me to stick with JQuery when I can. I started doing Web 2.0 programming with Prototype, and it's okay. I've touched MooTools a bit; I've also done Yahoo's UI Javascript library, but I love JQuery best of all.

If you want more information about how to use it - go to http://www.jquery.com as well as http://www.jqueryui.com for more information about widgets and interactions you can do.

Published by Tim Searles

I am currently involved in web development, consulting, and freelance writing. I also love music, art, having fun, and life.  View profile

To comment, please sign in to your Yahoo! account, or sign up for a new account.