A
A
Ayvwoto2018-02-14 17:44:00
JavaScript
Ayvwoto, 2018-02-14 17:44:00

The ajax script does not work, does not receive data from the handler, what should I do?

There is ajax code:

$('.add-to-cart').click(function(){
    
    var id = $(this).attr("rel");
    
    $.ajax({
      type: 'POST',
      url: '/functions/addtocart.php',
      data: 'id='+id,
      dataType: 'html',
      cashe: false,
      seccess: function(data){
        loadcart();
      }
    });
    });
  
  function loadcart(){
    $.ajax({
      type: 'POST',
      url: '/functions/loadcart.php',
      dataType: 'html',
      cashe: false,
      seccess: function(data){
        $('.cart-contents').html(data);
      }
    });
  }

but the loadcart function does not change the .html(data) of the selected class, loadcart.php gives the answer.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
imhuman, 2018-02-14
@imhuman

seccess don't think about it))

S
Stimulate, 2018-02-14
@Stimulate

Let's start with
seccess => success
cashe => cache

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question