Wednesday, August 13, 2025
90.0°F

Dynamic design for your Web pages

| September 4, 2011 9:00 PM

Dear PropellerHeads: I'm a novice Web page designer and would like to make my sites more dynamic. Some friends suggested I look into jQuery. What's that?

A: Finally! A question I can sink my teeth into! Don't get me wrong. I'm more than happy to discuss tips for making Windows easier to use or how to find the best anti-virus software or how to save some money when shopping for flights. But the truth is, I'm a programmer at heart and would always prefer to talk about something more technical. Which is what I'm about to do.

In two words, jQuery can be described as a JavaScript framework. OK, so what is that? Basically, it is a collection of frequently-used programs utilized on websites to make them as cool as possible, while at the same time making the life of the Web developer as easy as possible.

And jQuery is far from the only option. In fact, there are dozens of choices (http://bit.ly/wUtP9). But in order to cut through the chaff, the top five (according to me and nobody else) would include Dojo (dojotoolkit.org), jQuery (jquery.com), MooTools (mootools.net), prototype (prototypejs.org) and YUI (developer.yahoo.com/yui).

Most frameworks offer two types of functionality. The first is the basic plumbing. This seemingly unsexy set of features offers Web developers methods to do very common tasks like reference an HTML tag, change the content of an HTML tag, handle a user-triggered event like mouseover or drag and drop, or talk to a Web server without doing a full page reload.

Zzzzzz. Right? Wrong fool! The frameworks know all the dirty little secrets about the various Web browsers and operating systems in use, so no matter if the user is visiting your site with Firefox on Windows 8, Internet Explorer on RedHat (that is soooo funny I can't stop laughing) or Safari on an iPhone, your JavaScript code will work exactly the same for all of them. This abstracting of the Web browser is usually the first reason why developers turn to a JavaScript framework. It saves us a ton of time.

But wait, it only gets better! The second thing most frameworks offer are a bunch of widgets. These are things like calendars, panels, trees, menus, tables and charts. Anybody who has spent the time putting together from scratch a little popup calendar for entering a date knows that it takes days or even weeks. But by using a pre-existing widget built on top of one of the frameworks, that time gets cut down to hours or even minutes.

So far, all this seems pretty selfish. As Web developers, we are saving ourselves a massive amount of time by leveraging a JavaScript framework. But what does it do for you? Yes you, Hank Paulson of Portland, Indiana. Well, first off, have you seen how cool some of these widgets are?

Take auto-completion, for instance. Google popularized this years ago, but now you are disappointed if, for example, a travel site doesn't auto-complete your travel departure and arrival options for you. Are you listening, Orbitz? Missing your JavaScript framework now, aren't you?

Or what about that calendar? Not only are you expecting it when entering a date, but you also want it to fade into existence seamlessly and look, well, cool, not like something out of 1997. Apparently, United didn't get the memo on that one.

And finally, let's not forget that by using a framework, a website is truly allowing you to use whatever Web browser you wish. The days where you run across a website that won't work in anything but Internet Explorer are growing short. And you owe some of that thanks to JavaScript frameworks.

Thank you jQuery. I love you. We all love you.

When the PropellerHeads at Data Directions aren't busy with their IT projects, they love to answer questions on business or consumer technology. Email them to questions@askthepropellerheads.com or contact us at Data Directions Inc., 8510 Bell Creek Road, Mechanicsville, VA 23116. Visit our website at www.askthepropellerheads.com.