When dealing with Javascript content on a larger website, what is the best way to efficiently manage it? I am facing challenges with multiple $(document).ready()'s and the need to handle numerous id strings ($('#id')). One idea was to combine the necessary $(document).ready() with each "module" that utilizes them, but this approach led to visible speed degradation as my javascript is no longer at the bottom of each page.
How can Javascript on a fairly large site be managed effectively while still keeping it easy to maintain?