Good news for all fans of this framework. On the birthday of the library (which is now three years old), the development team
announced the release of a new version - 1.3!
Download the new version of the framework at the following links:
What's new?
Sizzle: New Selector Technology
First of all, I want to say about the new technology of selectors, which was called
Sizzle . Among its features, they highlight the speed, which is claimed to be 49% better than in the previous version of the framework. In addition, there is a comparison with the work of selectors in other libraries:
At the same time, the technology itself was endowed with complete autonomy and autonomy, therefore it can be used further by the authors of other popular frameworks.
')
Live events: live events
The so-called “live events” appeared in the new version - events that can be defined for all current and subsequent elements:
$ ("p"). live ("click", function () {
$ (this) .after ("<p> Another paragraph! </ p>");
});
See a
live example .
Event object
The technology of processing events that were included in the new
jQuery.Event object, which functions normally in all browsers, was seriously reworked. Detailed information about the changes will appear later.
HTML code injection
All code responsible for injecting code into HTML and working with DOM (such as
.append()
,
.prepend()
,
.before()
, etc.) has also been rewritten. As a result, again, the speed of these operations was increased compared with other libraries:
Offset method
The .offset () method, which calculates the position of objects, is now also updated and faster:
User Browser Definition
The new version uses a unique technology to identify the user's browser: instead of using the usual identification through userAgent, jQuery models the specific features of each browser or tries to cause a typical error. All this is collected in a special
jQuery.Support object. At the same time, the
jQuery.browser object is still present in the library.
Critical changes
Developers are asked to pay attention to a number of changes that may cause errors when installing the new version of the framework on the page with the code for the previous version:
- The '@' character in the
[@attr]
style selector has been removed. Deprecated since version 1.2, this syntax no longer works. Just remove @
in your code to work with the new version. - Events in triggers are now raised by the DOM. Your old handlers can now randomly log more events than needed.
- The
.ready()
method no longer waits until all the CSS are loaded. To work correctly, you must make sure that all styles are connected before the scripts work. .isFunction()
become simpler, the range of supported functions has decreased (excluded functions provided by browsers, such as alert()
, as well as DOM methods, for example getAttribute
)- The order of style selectors “a, b, c” may vary. Browsers that support querySelectorAll (Safari, Firefox 3.1+, Opera 10+, IE 8+) will return the items in the order in which they are located in the document; in the rest, the order may be different. In version 1.3.x everything will be fixed.
- Triggers and their handlers no longer accept event objects as an array; now they need to be defined directly as arguments.
- The undocumented extra-function is no longer used in triggers and their handlers.
- jQuery.event.trigger no longer returns the last element returned by the handler. You must use the jQuery.Event object to get the desired return value ( event.result ).
- Make sure that the page is working normally. There are cases when some methods worked incorrectly with compatibility mode enabled (including an error in the operation of selectors in Safari).
Full list of changes
posted on the official website of the plugin .
In the next week or two, version 1.3.1 will be released with fixes for all found bugs.
Do more, write less! ;)
UPD: Added a list of critical changes.