Proper way to arrange the jquery event binding in large applications

95 views Asked by At

While working in highly interactive and animated client side web applications, we highly rely on jQuery libraries and use their events heavily.

In large enterprise applications, this results in a big connection of the events, their callbacks and further to their internal method calls of 4 digit lines of code. That starts looking like a giant vessel filled with noodles or a huge program full of goto labels difficult to debug.

My question is, how can we arrange the events, the callbacks and related procedures in a cleaner, readable and maintainable manner? In Java, we can have different design patterns and separate classes to handle this. How can we achieve that in javascript.

Thank you in advance. Any handful link will also be highly appreciated

1

There are 1 answers

1
Milind Anantwar On

try using require.js dependency management framework.

it helped me lot for managing my jquery stuff.