When an image is clicked, I trigger an ajax call. The image includes an href tag that opens a different page in a new tab upon click. The purpose of this ajax call is to record the user's clicks on the image for telemetry purposes in a database table. Since I am not expecting any data to be returned from the ajax call, do I really need to include the "success" parameter?
var url = '/Home/ClicksCount'
$.ajax({
url: url,
type: 'POST',
data: { imageclick: 1 },
success: function (data) { }
});
This function is triggered when the image is clicked. Should I keep the success parameter in the ajax call, or can I safely remove it? I don't want to display an error message if the ajax call fails at this moment.