Permanent active reference to jquery



  • There's a code to update the part of the page without reloading. One reference in the pressurization remains active, and the only thing I can't do is an active reference when the page is open. activ_but I was always open. I was supposed to use the trigger, but I can't do it.

    $(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({
    });
    });

    });



  • $(function() {
      $("#urls a").each(function() {
        if ($(this).hasClass("active")) {
          $("#content").load($(this).attr("href"));
        }
      });
    });
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
    <div id="urls">
      <a class="active" href="index.html">active</a>
      <br>
      <a class="notactive" href="page.html">not active</a>
    </div>
    <div id="content"></div>




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2