Answer the question
In order to leave comments, you need to log in
How to make an AJAX request to delete a product?
Hello. Tell me please. Here is the code for removing a product from the page deferred
Ajax
$('.delay').click(function(){
var deletebasketid = $(this).attr('id');
ajaxpostshow("/ajax/delete.php", deletebasketid, ".col-sm-1-5" );
return false;
});
<?foreach($new_arr as $key => $value){?>
<div class="col-sm-1-5">
<p><a href="/?action=delete&id=<?=$value['ID'];?>" class="delay" id="ajaxaction=delete&ajaxdeleteid=<?=$value['ID'];?>">
<span class="delete"></span>Удалить</a></p>
<a href="<?=$value["DETAIL_PAGE_URL"]?>">
<div class="goods">
<div class="goods-description"><p><?=$value['NAME']?></p></div>
<div class="price text-center">
<span class="new-price"><?=$value["PRODUCT_PRICE_ID"]?> руб.</span>
</div>
</div>
</a>
</div>
<?}?>
Answer the question
In order to leave comments, you need to log in
ajaxpostshow("/ajax/delete.php", deletebasketid, ".col-sm-1-5" );
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question