1

I am trying to call a function everytime a .element is created or deleted, or when the content of a .element changed. I can use livequery for the creation event; is there a way to register "edit" or "delete" callbacks?

Thank you in advance!

Donovan
  • 6,002
  • 5
  • 41
  • 55

1 Answers1

1

livequery can handle the deletion of the element. Pass a second function argument. It will run when an element that matches the selector is removed.

With respect to edit, I suppose it will depend on the type of edit. If you remove a class such that it no longer matches the selector you gave to livequery, I think the second function argument will be triggered in that case as well.

user113716
  • 318,772
  • 63
  • 451
  • 440
  • Thanks for pointing this out. About the change event, this is what I need http://stackoverflow.com/questions/3233991/jquery-watch-div/3234646#3234646 – Donovan Jul 03 '11 at 15:15