New jQuery Version Released Version 1.3
Posted by Blerz on
January 28, 2009
jQuery, in my opinion the best Javascript framework for web development, has a new version, 1.3, with some changes that could affect the way you use jQuery.
First things first, you should read the release notes at the jQuery site: http://docs.jquery.com/Release:jQuery_1.3 to familiarize yourself with the changes.
A couple of the more important changes that I will need to make in my own code:
- The ready() method no longer waits for the css to load. The script should be placed after css files.
- Toggle() now accepts a boolean value.
Also, according to the NetTuts article, the jQuery development team has put some serious effort in optimizing a couple of features that I use in almost every project with jQuery.
The Hide/Show feature of jQuery and DOM Manipulation and HTML Insertion were the focus of these optimization tasks, and I promise you, if you use jQuery, you will use these functions.
For example, in a recent project I did, LesleyBarrPhotography.com, I used an image replacement technique which is very simple and easy to maintain:
$(document).ready(function() {
$("#showcustom img").hover(
function()
{
this.src = this.src.replace("_off","_on");
},
);
The idea here is to have 2 images, 1 named custom_off.png, and 1 named custom_on.png. On mouseover, jQuery will just replace one image with the other, as specified in the this.src = this.src.replace(”_on”,”_off”); code, via manipulating the DOM. I will test this under jQuery 1.3, as I have noticed that in FireFox version 3.x, the DOM Manipulation under jQuery 1.2.6 can be a little flickery. Hopefully the new version will have smoothed that out, as it is one of my favorite jQuery functions.
Technorati Tags: jQuery, jQuery, Ajax, jQuery 1.3, jQuery Tutorial


