We use a 3rd party control suite which has a JQuery global ajaxError
event which we would like to customize. We don't want to update this JS file but want to somehow override it so that JQuery doesn't execute this event.
Is this possible?
EDIT: Third Party Code
ajaxError: function (element, eventName, xhr, status) {
var prevented = this.trigger(element, eventName,
{
XMLHttpRequest: xhr,
textStatus: status
});
if (!prevented) {
if (status == 'error' && xhr.status != '0')
alert('Error! The requested URL returned ' + xhr.status + ' - ' + xhr.statusText);
if (status == 'timeout')
alert('Error! Server timeout.');
}
}
I wan to nullify the line starting from the if condition
You could overwrite the whole method but not only a single statement.
EDIT:
The library you're using is built using prototypes I guess. Just noticed you're using jQuery. Therefore you might use jQuery.fn instead of LibName.prototype. Overwriting it would look similar to:
jQuery.fn.ajaxError = function(element, eventName, xhr, status) {
var prevented = this.trigger(element, eventName,
{
XMLHttpRequest: xhr,
textStatus: status
});
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With