Why trigger("click") is called multiple times?

Hello, I wrote code to add and remove products. When you add or remove the function that displays the products is updated on the page with the new values. The problem is than, when I add a product for example 5 times, and want to remove some, then the feature is triggered 6 times, and if you try to add the item then it is added to 7 times, respectively. If only to remove or add items then everything works fine. Here is the delete function. What is the error?
jQuery(document).one("click", "#delete_product", function() {
 var product_id = jQuery(this).parent().parent().find("td.product_id").text();
console.log("delete_product="+product_id);
jQuery.ajax({
 url: '/site/product/controller.php',
 type: 'post',
 contentType: 'application/x-www-form-urlencoded',
 dataType: 'html',
 async: true,
 data: 'func=delete_product&product_id=' + product_id,
 success: function (data) {
console.log(data);
jQuery.notice(data);
jQuery("#get_product").trigger("click");
}
});

 });
March 23rd 20 at 19:13
0 answer

Find more questions by tags jQueryJavaScript