diff --git a/accounting/static/accounting/js/account-form.js b/accounting/static/accounting/js/account-form.js index 8b2ca63..280d5c6 100644 --- a/accounting/static/accounting/js/account-form.js +++ b/accounting/static/accounting/js/account-form.js @@ -50,8 +50,8 @@ let accounts; */ function getAllAccounts() { const request = new XMLHttpRequest(); - request.onreadystatechange = function() { - if (this.readyState === 4 && this.status === 200) { + request.onload = function() { + if (this.status === 200) { accounts = JSON.parse(this.responseText); } }; diff --git a/accounting/static/accounting/js/transaction-form.js b/accounting/static/accounting/js/transaction-form.js index d6b43fb..1abfb39 100644 --- a/accounting/static/accounting/js/transaction-form.js +++ b/accounting/static/accounting/js/transaction-form.js @@ -91,8 +91,8 @@ let accountOptions; */ function getAccountOptions() { const request = new XMLHttpRequest(); - request.onreadystatechange = function() { - if (this.readyState === 4 && this.status === 200) { + request.onload = function() { + if (this.status === 200) { accountOptions = JSON.parse(this.responseText); $(".record-account").each(function () { initializeAccountOptions($(this));