Ensure DOM is loaded before binding the global AJAX error handler.
This commit is contained in:
parent
e7b4aeedab
commit
88028d5770
1 changed files with 4 additions and 2 deletions
|
@ -25,8 +25,10 @@ window.GeneralFunctions = window.GeneralFunctions || {};
|
|||
/**
|
||||
* Register global error handler.
|
||||
*/
|
||||
$(document).ajaxError(function (event, jqxhr, settings, thrownError) {
|
||||
GeneralFunctions.ajaxFailureHandler(jqxhr, settings, thrownError);
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
$(document).ajaxError(function (event, jqxhr, settings, thrownError) {
|
||||
GeneralFunctions.ajaxFailureHandler(jqxhr, settings, thrownError);
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue