The old way:
After each action, I have to write my functions, which should be called. This method works, of course. But it is not clear. It is more interesting to define my functions and than I want to define, after which actions these functions should be called. That should be done without changing the action. So I have tried to use jQuery for this way.
The new way:
jQuery offers the ability to abstract event handling between browsers. And this abstraction is done very well. It allows to expand possible events.
Imagine, you have an action called “action1”. I want to register some functions, which should be called in this action. So try this:[source:js]
It’s easy to call function1 and function2 in action1 now: Just write…[source:js]
… to the end of your action. That’s it. You can add new functions easily by binding them. Even no binding is possible (if there is no function, which should be called).