diff --git a/assets/js/general_functions.js b/assets/js/general_functions.js index 44e0e61a..436fa6c9 100755 --- a/assets/js/general_functions.js +++ b/assets/js/general_functions.js @@ -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); + }); }); /**