i am using half dozen jquery plugins and plus my own jquery scripts and in every script i have this code:
$(document).ready(function()
{ .... }
what is the best way of organizing all the scripts in one centeralized location and instead of having multiple times $(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 would i organize the above .js files?, you see above having mulitple times $(document).ready(function().