I'm in the process of updating a site that currently uses jQuery 1.3.2 to at least 1.10.2. When I do, the site chokes on commands like this:
this.form.find(':select[name="fieldtype"]');
This shouldn't work - it should be: this.form.find('select[name="fieldtype"]'); - without the colon - but it in fact works.
I've found nothing that suggests ':select...' is valid. Is it possible that the colon was simply ignored in jQ 1.3.2?
EDIT:
I completely forgot about custom pseudo selectors. If, for legacy purposes you need a newer version of jQuery to treat :select like select, you can do this:
jQuery.extend(jQuery.expr[':'], {
select: function (el) {
return jQuery(el).is('select');
}
});
And now jQuery(':select') and jQuery('select') are equivalent expressions.
Explanation
It appears to be an error with the sizzle css selector engine used by jquery, so that jquery could select dom elements before document.querySelectorAll was a thing (or a widely available thing). jQuery 1.3.2 uses sizzle 0.9.3 (pre version 1!), the next version of jQuery, 1.4.0, uses sizzle 1.0.0, where the bug is not present.
The bug specifically seems to be that proper tags prefixed with a ":" will be interpreted as a tag rather than an invalid pseudo
You can verify sizzle being the culprit:
Your "hybrid 1.3.2" version will now also reject the selector.