John Resig wrote:
I am writing some code using end() method and really, I don't see the
time where
".onclick() might return a statement that /requires/ a .end() to exist"

Some example??

Right, that's because it doesn't exist :-) Only the following code is
guaranteed to work:

$("div.section")
  .find("dt")
     .addClass("section")
     .click(function(){
        $(this).next().toggle().end()
     })
  .end()
  .find("dd")
     .hide()
     .filter(":first")
        .show()
     .end()
  .end();
Mmmm, the code:

$("div.section")
   .find("dt")
        .addClass("section")
    .click(function(){
         $(this).next().toggle()
    })
   .end()
   .find("dd")
       .hide()
   .filter(":first")
       .show();

works for me, http://projects.sevir.org/storage/test/test.html . Apart the good practices, I can't
see the problem if I remove the end() calls in toggle, and the latest two.

--
Best Regards,
José Francisco Rives Lirola <sevir1ATgmail.com>

SeViR CW · Computer Design
http://www.sevir.org
Murcia - Spain

Reply via email to