When I click the delete button it stops working, but I click on another button and it works again 2 more times

0

When you click the delete button it stops working, but I click on another button and it works again 2 more times, or at least it refreshes the browser to make it work again.

<script>  
  $(document).ready(function() {
          $('.eliminarbt').click(function(e){          

   var ideliminar = $(this).attr("id");     
  $.ajax({
      method: "POST",
      url:"carrito.php",
      data: {ideliminar:ideliminar},
      success:function(data){                         
          $('.table').html(data);          

      }
  });    

    });        

    $('.btsiguiente').click(function(){

    var total = parseInt($('#total').val());            

        if(total <= 0){
            alert("Carrito Vacio");

        }

        else{
            window.location.href='compra.php';

                }                    

            });          

    });               

</script>
    
asked by Steban De Abreu 29.08.2018 в 21:02
source

1 answer

0

It may be that it is being frisked ... Try this:

$.ajaxSetup({ cache: false });
    
answered by 29.08.2018 в 21:08