My problem is that on pageload a checkbox is triggered and because of this an ajax call is made which makes my page load very slowly.
I have located the code that triggers these checkboxes:
My jQuery script
$('.checkGroup > input[type="checkbox"]').live('change',function(){
$t = $(this);
$t.closest('.checkGroup').find('.payload').toggle( $t.is(':checked'));
if( !$t.is(':checked') ){
$t.closest('.checkGroup').find('.payload input[type="checkbox"]')
.attr('checked',false);
}
}).trigger('change');
$('.checkGroup input[type="checkbox"]').change(function(){
$c = $(this);
$c.closest('.checkGroup').find('label > span b')
.text( $c.closest('.checkGroup')
.find('input[type="checkbox"]:checked').length
);
}).trigger('change');
How can I disable this onload or any other way?
remove
.trigger('change')since it triggers the event for the very same functions you are showing.