0

It's really not a duplicate, please read it before tagging.

I have a button with multiple events being attached (save, validate, etc.). In one controller, I'm attaching a function, which I need to execute as the last event. I can't move with other code much, its a big company project (=can't affect the order in which controllers are being called and the events attached). I can see that my function is not the last one getting attached.

I found a way to make sure that the function is executed first - which is more convenient because the events attached after the function go to the end and don't affect it anymore.

But is there a way to make sure the function is always being called last, no matter what?

  • 1
    possible duplicate of [jQuery event handlers always execute in order they were bound - any way around this?](http://stackoverflow.com/questions/2360655/jquery-event-handlers-always-execute-in-order-they-were-bound-any-way-around-t) – Sergiu Paraschiv May 12 '15 at 14:59
  • Not really - there is explained how to force event to be the first, but I need it to be the last one and that is not so easy to achieve. – IvaNavratilova May 12 '15 at 15:03
  • 1
    No, that's another question. The one I pointed you to _is_ marked as a duplicate of that one but has a better answer: http://stackoverflow.com/questions/2360655/jquery-event-handlers-always-execute-in-order-they-were-bound-any-way-around-t#answer-2641047 – Sergiu Paraschiv May 12 '15 at 15:10

0 Answers0