📜 ⬆️ ⬇️

jQuery 1.4.2

image JQuery updated to version 1.4.2
Fixed several bugs and added a bit of functionality.

1) 2 new .delegate () and .undelegate () methods have been implemented , designed to complement the .live () and .die () methods. These methods make it easier to work with certain specific events.

For example:
$( "table" ). delegate ( "td" , "hover" , function (){
$( this ).toggleClass( "hover" );
});



This is equivalent to the following code written using .live ():
$( "table" ).each( function (){
$( "td" , this ).live( "hover" , function (){
$( this ).toggleClass( "hover" );
});
});


2) improved performance - TaskSpeed ​​test - Judging by the abundance of dark green color (the fastest / baseline) in the jQuery 1.4.2 column breaks into unconditional leaders. (Although tests are not a real application, of course)
Improved .bind () and .unbind () call ( Ticket )
improvements in .empty (), .remove (), and .html () ( Ticket )
Improving the insertion of a single DOM element into a document ( Ticket , Additional Commit )
Improved call $ ("body") ( commit )
')
jQuery Minified ( 24kb Gzipped )
jQuery Regular (155kb)

Functional change
jQuery 1.4.2 Released - examples of using new functions

Source: https://habr.com/ru/post/84995/


All Articles