jquery 1.4.2 update

jquery 1.4.2 update

pwc1011pwc1011 Posts: 62Questions: 0Answers: 0
edited February 2010 in General
Hello Allan,

Did you see the new delegate update to 1.4.2? Might come in handy on DataTables

this...

[code]
$("table").delegate("td", "hover", function(){
$(this).toggleClass("hover");
});
[/code]

simplifies this...

[code]
$("table").each(function(){
$("td", this).live("hover", function(){
$(this).toggleClass("hover");
});
});
[/code]

Here's the info: http://blog.jquery.com/2010/02/19/jquery-142-released/

Patrick

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Does that provide an optimisation over:
    [code]
    $("table td", this).live("hover", function(){ ... });
    [/code]
    Having said that - it does look like something which will help. Anything which improves support for event delegation I'm all for!

    Allan
This discussion has been closed.