There is a view of a basket with goods.

When you click on delete goods, you need to update the same view with ajax (-a).

The problem is that this view gets into the ajax function, but it’s not clear where to insert it with the $('').html(); method $('').html();

 public function actionDelItemApp($id) { return $this->render('view'); } 

Ajax:

  $.ajax({ url: '/cart/del-item-app', type: 'GET', data: {id: id}, success: function (data) { if (!data) alert('PRODUCT NOT FOUND!'); $('НЕ ЗНАЮ КУДА ВСТАВЛЯТЬ').html(data); } }); }); 

Representation:
div.section , etc.

All content of the div.section block div.section it gets to div.section .

And where to insert the result?

  • one
    For specifics, it would be good to bring your code in which you are having difficulty - Sublihim
  • I need to put the data in $ content somehow in logic, which is used in the template for displaying the view. But this is not the case - Nikita

1 answer 1

I solved the problem: I wrapped the $ content template in a block div class = "app-container" Now the answer to the AJAX is displayed there, and + it was necessary to delegate the event by clicking on the delete icon.