From 9193a29a44d90ad48fd5ff8434d740315411151f Mon Sep 17 00:00:00 2001 From: Jerome Nadaud Date: Thu, 31 Oct 2013 19:02:43 +0100 Subject: [PATCH] [+] MO : Blockcart - Add error handler on ajax function --- modules/blockcart/ajax-cart.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/blockcart/ajax-cart.js b/modules/blockcart/ajax-cart.js index f15c32365..ea86631fe 100644 --- a/modules/blockcart/ajax-cart.js +++ b/modules/blockcart/ajax-cart.js @@ -131,6 +131,9 @@ var ajaxCart = { success: function(jsonData) { ajaxCart.updateCart(jsonData); + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + alert("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus); } }); }, @@ -736,7 +739,10 @@ $(document).ready(function(){ headers: { "cache-control": "no-cache" }, async: true, cache: false, - url:$(this).attr('href') + '?rand=' + new Date().getTime() + url:$(this).attr('href') + '?rand=' + new Date().getTime(), + error: function(XMLHttpRequest, textStatus, errorThrown) { + alert("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus); + } }); $(this).parent().parent().remove(); if ($('body').attr('id') == 'order' || $('body').attr('id') == 'order-opc')