Silverfen Web Design

jQuery

jQuery is highly flexible Javascript library that was first released in 2006. Its page on Wikipedia says that it is used on 49% of the 10,000 most visited web sites. It is amazingly flexible, and allows elements in a web page to be interacted with in very rich ways.

Putting that into perspective: most of the web sites I have developed include a file of handy javascript functions. Over the years these have accreted, and my habit was periodically to jettison those things that had become redundant. Using jQuery instead gives access to an extremely rich set of Javascript tools without the need to write them myself. It also provides a really straightforward way to select different elements on web pages and alter them.

The significance of this is that normal Javascript enables the selection of lots of different elements in a web page, so a gimmicy use might be to change the colours of all the paragraphs on a page. In computing terms, all the elements in a web page are connected but in practice it can be a complex task to navigate to specific items. On top of that, different browsers’ support for the more sophisticated facilities of JavaScript is rather patchy so, for example, Firefox, Safari and Opera all implement the getElementsByClassName() function, which, as its name implies, allows all elements of the same classname to be selected, but however useful this looks, it is hobbled by the fact that Internet Explorer doesn’t support it. In jQuery there are some remarkably powerful tools for selecting elements which get round all of this. There are also some really handy ways of altering the appearance of elements by altering their styles.

From a programmer’s perspective makes this really powerful is that commands can be chained — set up so that the output of one becomes the input of another, so you can often do in one, eminently readable, line of code something which would take many lines of less penetrable JavaScript. There’s also a large range of plug-ins which extend jQuery in helpful ways.

The upshot is that the next few Silverfen web sites are likely to make significant use of jQuery, and be rather faster to develop, and more robust when complete, both of which are appealing.