I have a MVC app in which I'm using jQuery to call specific actions in a controller to add items to a cart.
Now, the app is running as it should, but when I'll leave the app to sit in the browser and comeback after lets say 1 hour, and I'm trying to add a item to the cart, clicking the button doesn't cause any action and I'm getting this error:
SCRIPT7002: XMLHttpRequest: Network Error 0x80700013, Could not complete the operation due to error 80700013.
This is the script which should be triggered:
$('button.submitButton').click(function() {
var itemName2 = $(this).data('name');
$.ajax({
url: '@Url.Action("AddToCartAjax", "Cart")',
data: { itemId: $(this).data('id'), categoryId: $(this).data('categoryid') },
dataType: "json",
type: 'POST',
success: function (data) {
UpdatePartialView(data);
$(".modal-body #cartTotalLabel").text('Order Total £' + data.Total);
$(".modal-body #cartItemName").text(itemName2 + ' added');
$('#createModal').modal('show');
setTimeout(function () { $('#createModal').modal('hide'); }, 2000);
}
});
}
});
What should I do to fix this error?