There is a code to update part of the page without reloading. When you click one link, it always remains active, but the only thing I can’t do is that when you open the page, the active activ_but link remains constantly open. It was proposed to use the trigger, but something I can not
$(document).ready(function(){ var user = <?=$uss?>; var ser = <?=$id_s?>; $('.watch-s a').click(function(e) { e.preventDefault(); $('.watch-s .activ_but').removeClass('activ_but'); $(this).addClass('activ_but'); if ($('#knopa1').attr('class') == 'activ_but'){ $.ajax({ } }); } if ($('#knopa2').attr('class') == 'activ_but'){ $.ajax({ } }); } if ($('#knopa3').attr('class') == 'activ_but'){ $.ajax({ } }); } if ($('#knopa4').attr('class') == 'activ_but'){ $.ajax({ } }); } var rzd = $(this).attr("rzd"); jQuery.ajax({ }); }); });