خرید بک لینک

Vote count: 0

I use URL to remove products outside a cart. For this I use the following HTML:

<button type="button" class="btn btn-link btn-xs btn-remove-from-cart" onclick="removeItem('p','{$num}')"><i class="fa fa-times"></i></button>

When clicking on the button, the following script is triggered:

<script>
{literal}
function removeItem(type,num) {
  var response = confirm("{/literal}{$LANG.cartremoveitemconfirm}{literal}");
  if (response) {
    window.location = 'cart.php?a=remove&r='+type+'&i='+num;
  }
}
{/literal}
</script>

The problem is that it does work, but the results are not visable. This because the page need to be refreshed to see that the product is removed.

Is there a way to change the script, so that the page is reloaded? Or better, that the product will be removed using AJAX, without refreshing the page?

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: شنبه 22 خرداد 1395 ساعت: 17:28

صفحه بندی