New jQuery boosts web site speeds

04.05.2011
A widely used open source library for simplifying Javascript-based Web application development has just gotten a performance jolt.

JQuery version 1.6, , features a number of revisions that should help JavaScript-rendered Web pages run a bit more quickly.

"Keeping your application up-to-date with the latest version of jQuery is always advisable, as it allows you to leverage the performance and API improvements the team is constantly making," said Adam Sontag, a member of the jQuery developer relations team.

In terms of performance improvement, the development team has revamped how jQuery handles HTML attributes, drawing a clear line between attributes on HTML tags and JavaScript properties of the corresponding DOM (Document Object Model) elements. Attributes define initial variables of a page, such as the size of an image. Instead of mixing attributes and properties together inside of selected methods, two new methods, ".prop()" and ".removeProp()" have been added for directly manipulating properties, Sontag noted. These new methods have sped up performance of attribute and property handling across all browsers, the team reports.

Another improvement: The performance of event handlers -- such as a mouse click -- has been improved due to changes in the ".data()" method. The handling of hyphen-delimited data attributes has been modified to comply with the W3C standards.

Support for animations have also gotten a boost: jQuery now has a timer that can synchronize multiple animations on a single timing schedule. It also has support for the requestAnimationFrame specification in browsers where it is supported, which can help animations run more smoothly by alerting the browser when to repaint the palette for each animation frame.