JQuery 1.9 released
Today, a new release of jQuery version 1.9 has finally been released. Let's look at what innovations and changes we will see here.
Jquery 1.9 and beta-based Jquery 2.0 have a similar API.
Some obsolete features, such as $ .browser, have been removed.
JQuery 1.9 is still running on older versions of Internet Explorer 6, 7, and 8. But in JQuery 2.0, support will be discontinued. Thanks to this, he will work faster and weigh, respectively, less.
Version 1.9 is already available on the jquery CDN and will soon be available on Google and Microsoft CDN.
For those who want to test their scripts on JQuery 2.0 Beta 1, you can use the JQuery CDN:
For verification, you can connect the jquery-migrate plugin. To see what changes may cause problems with your code. No matter what version of jquery you are using, be sure to open the console to see the warnings or errors that jquery-migrate generates. Warnings begin with the word "JQMIGRATE" and are listed in the plugin documentation. This will help you understand what is broken and how to fix it.
WHAT'S NEW IN 1.9
Simplified API: many obsolete and dubious features have been removed as described in the manual update.
Updated .css () function: Now you can get all css values by querying an array with keys: Extended CSS3 cross-browser support: JQuery 1.9 now supports the following CSS3 selectors in all browsers:: nth-last-child,: nth- of-type,: nth-last-of-type,: first-of-type,: last-of-type,: only-of-type,: target,: root, and: lang. New .finish method: This method can be used to immediately complete all animations in the queue for an element.
var dims = $("#box").css([ "width", "height", "backgroundColor" ]);
// { width: "10px", height: "20px", backgroundColor: "#D00DAD" }
Other fixes
AJAX
# 12004: Added ajax.method as an alias for ajax.type
# 12550: Fixed JQuery Ajax cache = false
ATTRIBUTES
# 9905: did not always work . RemoveAttr ("ID") no longer crashes in IE7
# 12048: [IE6 / 7/8] XML attribute set
# 12584: JQuery incorrectly serializes with one broken # 12600: jQuery ('select'). Is ('[value = “Value”] ') works inconsistently depending on the number of returned items.
# 12945: Attr throws an exception in IE9 on Flash object
# 13011: Setting the type attribute on the input does not work as expected
BUILD
# 12254: Reflected XSS
# 12725: Non-localized UTF-8 characters in intro.js
# 12741: incompatible end of line in official JQuery-1.8.2.js
CORE
# 11737: Deleted jQuery.sub
# 12134. Implementations of HTML5 compilant data form in $ fn.serialzeArray
# 12519: Public API methods must not have privat arguments
# 12840: Removed (privat) pass parameter in jQuery.attr and jQuery. access
# 13021: each () cannot work well with large objects
# 13075. Performance optimization $ .type
# 13076: Performance optimization (10-30%) for $ (“some-selector”)
CSS
# 11938: jQuery.css should take an array to get some properties
# 12990: “px” is automatically added to the quantity column in CSS
# 13088. Under IE8, $ (selector) .attr ('style') always returns a string
References
Official site
The whole list of changes
Migration Guide