Possible Duplicate:
JQuery - multiple $(document).ready …?
I have my JS code that is using jQuery within the jQuery Document Ready IE:
$(function() {
});
I am running multiple jQuery scripts on the page and all are contained within one $(function() { });
is there any reason I should break the scripts into multiple ready handlers? IE:
$(function() {
// First Script
});
$(function() {
// Second Script
});
//etc.
or is it okay to have multplie scripts within one? IE:
$(function() {
// First Script
//Second Script
//etc.
});
I assume one is just fine but I want to ensure there are no reasons I should use multiple ones.