The Rise of Javascript, part 1
For most of javascript’s history it was relegated to being a simple add-on to existing webpages. Most of the time, it was used to add minor interactivity or occasionally used as a hammer to iron out cross-browser quirks. In recent years javascript has gone from being an add-on to playing a leading role in web enhancements and web development. In doing so, it has sprouted in different directions and led to entire new technologies.
Meet jQuery
One of the most common sprouts is jQuery, a library designed to make the old school ‘add-on’ behavior easier, more predictable and more robust. jQuery is the last in a line of ever more complex libraries, each adding new functionality, easier APIs, and better performance. To web technology veterans, jQuery has become a tool of choice for exactly these reasons. For web users, it is the silent worker behind the scenes that gives modern websites so much of their polish and interactivity. There are other similar libraries like Prototype, mooTools, etc, but jQuery is by far the most common.
Rotating images? jQuery. Those fading menus, dropdowns, and drag and drop icons? Also jQuery.
Part of what has made jQuery so popular is the ability to create ‘plugins’ that extend the core functionality and speed of the jQuery library with new behavior. The largest extension is the jQuery UI toolkit that enables dynamic color selectors, animated calendars, etc.
With these behaviors becoming more and more common on websites, use of jQuery and it’s features has become less of an ‘add-on’ to existing sites and more of a requirement. Customers are becoming used to a highly interactive and responsive website. As the additional interactivity and polish granted by jQuery become more common, websites and web applications that don’t make use of these technologies risk coming off as antiquated or badly maintained.
The good news is that adding this technology to existing websites is relatively straightforward. jQuery was designed specifically with this role in mind, and documentation is widely available.
Javascript’s Changing Role
Other javascript based web technologies are far more radical than jQuery. Two prime examples are Node.js and Sproutcore.
Traditionally, Javascript was meant to run on websites, in a browser, on a client’s computer. Node.js is entirely the opposite. It runs outside a browser, delivers websites, and executes on the server. Node.js is a web server development framework/application designed to build lighting fast web services. This change of direction stems from the event driven nature of Javascript (different from many mainstream languages) and the lighting fast performance of the V8 Javascript engine developed by Google. While still young, Node.js promises to be an important part of future high performance/high I/O throughput web applications.
While Node.js replaces the typical web server, software like Sproutcore replaces the typical web page. Standard web pages are created with HTML and CSS, which is often generated by server side languages such as PHP, Ruby, or ASP.Net. The HTML/CSS is then enhanced with something like jQuery. With Sproutcore, the core language is Javascript. The library is loaded and then Javascript commands are given to generate the HTML and all other aspects of the application. The advantage of software like Sproutcore is consistency. Consistent language, consistent data structures, consistent software design patterns. Sproutcore also promises native mobile support in the relatively near future. With the backing of no less than Apple, Sproutcore is technology to watch.
In part 2, we will look at javascript and the mobile web.
