If you’re using WordPress 2.9.x, then the latest version of jQuery included is 1.3.2. What if you want to take advantage of new features in version 1.4, like delaying an animation queue or binding multiple event handlers? You can easily add a link in your header to the latest version, but that might end up conflicting with some plugins or themes.

The best approach would be to use the following piece of code to let WordPress know that you want to load the current version instead.

Place this into your theme’s functions.php file:

function current_jquery($version) {
        global $wp_scripts;
        if ( ( version_compare($version, $wp_scripts -> registered[jquery] -> ver) == 1 ) && !is_admin() ) {
                wp_deregister_script('jquery'); 

                wp_register_script('jquery',
                        'http://ajax.googleapis.com/ajax/libs/jquery/'.$version.'/jquery.min.js',
                        false, $version);
        }
}

add_action( 'wp_head', current_jquery( '1.4.2' ) ); // change number to latest version

If jQuery is updated, all you have to do is change the version number when calling the function.

Reference: Binary Bonsai