我們使用第三方控件套件,該套件具有我們想要自定義的JQuery全局事件ajaxError
。我們不想更新這個JS文件,但想以某種方式覆蓋它,以便JQuery不執行此事件。重寫第三方JS
這可能嗎?
編輯:第三方代碼
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.');
}
}
我婉抵消從if條件
它是如何綁定的?你可以給你想要取消的代碼? – lonesomeday 2010-11-02 20:14:11
@lonesomeday - 請參閱編輯 – DotnetDude 2010-11-02 20:16:29