I think there are conflicting goals in what you are trying to achieve: some of these things are common, and some of them are common to one page. If this is the last, then why is it in a common module?
Having said that, one of the approaches that we have successfully used is to transfer all commonly used functions to the main .js file, as well as to the entire site $(document).ready() .
Individual pages may have a localready() function, and the last step of $(document).ready() is to start it if it exists:
$(document).ready(function(){
And in the next document:
</body> <script> function localready() { foo(); bar(); } </script> </html>
So, if the page being displayed has a localready () function, it is called and does whatever it needs to do. If this is not the case, the standard ready () is executed, and that is.
Hope this helps.
source share