I hear nothing but great things about the newest version of jQuery 1.3. Has anyone experienced any problems upgrading from 1.2.6? I would love to use it but I want to know if there are any gotchas first.
EDIT: 1.3.1 is out.
I hear nothing but great things about the newest version of jQuery 1.3. Has anyone experienced any problems upgrading from 1.2.6? I would love to use it but I want to know if there are any gotchas first.
EDIT: 1.3.1 is out.
I am using 1.2.6 and it's working fine for me. I didn't know that Jquery 1.3 was released. Just checking it out and it sounds very exciting. Thanks for the information.
Edit: I just upgraded my existing 1.2.6 based project to 1.3 and it runs fine without any problems.
I've upgraded to the latest version with relative ease. Most of the major issues are detailed in the Release Notes.
I had one small issue that was not covered in the release notes; however, it was solved by Matthew Crumley and Jimmy P in the comments of my answer.
jQuery 1.3 open tickets will help (Requires Register/Login)
Also check the jquery dev google group
When I tried to upgrade it broke drag and drop using jQuery UI for me.
The only problems I've had with jQuery 1.3 have been selector issues (i.e. Sizzle). For example, this doesn't work with 1.3, it actually crashes Firefox:
$('ul:not('.whatever') a');
John [Resig] says he's looking into it though (http://groups.google.com/group/sizzlejs/browse_thread/thread/209f4e8c9b65d742).
I believe jQuery, with its latest release, no longer supports xPath selectors either. So you can't do this: [@name=whatever]...
The only gotchas that might occur are with the plug ins you are using. If the plug in developers have code that was dependent on deprecated methods then you'll need to wait till they are also updated before updating jQuery.
I had a problem with a selector matching <select> tags, such as
$('.size select')
For some reason it is no longer matching the <select> tag, but it's <option> tags instead. Navigating to the parent node solved the issue for me, but it's more like an ugly hack rather than expected behavior.
$('.size select').parent()
Anybody else noticed this problem?
The :not
pseudo selector is broken for Firefox and Internet Explorer (still works on Webkit) - it will put your browser into an infinite loop.
The workaround until it is fixed is to change your code:
// OLD:
$("a:not(.faq)")
// NEW:
$("a").not(".faq")
// OLD:
$(".menu li:not(.parent) a")
// NEW:
$(".menu li").not(".parent").find("a")
this is covered in Ticket #3837 which is marked as fixed, but hasn't made its way into the release.
I upgraded from 1.2.6 to 1.3.1 and this stopped working:
$("input[type=text][value='']").css("background-color", "red");
Failed in Firefox 3 with the error
[Exception... "'Syntax error, unrecognized expression: value='']' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)" location: "" data: no]
Line 0
I am upgrading a fairly heavy ajax site from 1.2.6 to 3.1 and have had only one issue so far. Within an each I was looking up attributes of an xml element and had to call toString() on the object in the loop. For example:
var items = ['foo','bar'];
var task = data.find("task");
items.each(function() {
var thingName = this;
var thingValue = task.attr(thingName<.toString() was added here but had been fine in 1.2.6>);
});
I was getting an error about invalid character (NS_ERROR_DOM_INVALID_CHARACTER_ERR) before forcing the object to be a string. Note that this was working in version 1.2.6 and represents a possible upgrade issue.