I use half a dozen jquery plugins as well as my own jquery scripts and each script I have this code:
$(document).ready(function() { .... }
What is the best way to organize all the scripts in one central location and instead of having multiple $ (document) .ready (function () everywhere in the script.
thoughts?
UPDATE
one.js
$(document).ready(function() { $("#aspnetForm").validate({ rules: { <%=txtVisitName.UniqueID %>: { maxlength:1, required: true }, deleted lines......
two.js
$(document).ready(function() { $("#btnSubmit").click(function(event) { if ($("#aspnetForm").valid()) SaveVisitBasicPage(); deleted lines......
Three.js
$(document).ready(function() { function initMenu() { $('#menu ul').hide(); $('#menu li a').click( deleted lines......
four.js
$(document).ready(function() { $("#ctl00_cphMaster_txtPurpose").NobleCount('#count01', { max_chars: 25, on_negative: 'go_red', on_positive: 'go_green', block_negative: true deleted lines......
how could I arrange the above .js files ?, you see above, with the verbose time $ (document) .ready (function ().
source share