loading newer jquery with hook_js_alter() breaks file upload on node edit form I'm using hook_js_alter() in my theme template.php to load jquery 1.7 to my frontend only, and I've noticed that doing this breaks filefield uploads.  

More specifically, once you select a file and click upload, the file will upload but the spinner just keeps looping.  If you click preview during this, then after the refresh you'll see the link to the file and the "remove" button.  If you click remove here, you'll see the same issue with the spinner continuously looping.  Hit preview again, and it'll refresh with the file removed.

I tested this method with jquery 1.5.2 as well and had the same problem, so its not a jquery problem.

This problem does not exist if using the dev branch of jquery_update module to load jquery 1.7.  But the issue with using this is it breaks field_ui and views functionality, so is not an option.

My code (very simple) is as follows, any ideas?

function mytheme_js_alter(&amp;$js) {
    if (isset($js['misc/jquery.js'])) {
        $jsPath = 'https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js';
        $js['misc/jquery.js']['data'] = $jsPath;
        $js['misc/jquery.js']['version'] = '1.5.2';
    }
}
Worth noting, Drupal is released with a particular version of jQuery. 
You generally can't add a newer version of jQuery without refactoring some core js files.

http://drupal.org/project/jquery_update

provides those core patches and more recent jQuery versions.