Replaced JavaScript XMLHttpRequest.onreadystatechange with XMLHttpRequest.onload.

This commit is contained in:
依瑪貓 2021-08-27 07:27:42 +08:00
parent 91d22d72cb
commit dec53c09f3
2 changed files with 4 additions and 4 deletions

View File

@ -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);
}
};

View File

@ -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));