This commit is contained in:
Aevann1 2021-10-06 01:21:23 +02:00
parent b58fdf3328
commit 672afac235
3 changed files with 3 additions and 2 deletions

View file

@ -7,7 +7,7 @@ function post(url, callback, errortext) {
xhr.onerror=function() { alert(errortext); };
xhr.onload = function() {
if (xhr.status >= 200 && xhr.status < 300) {
callback();
if (typeof callback === "function") callback();
} else {
xhr.onerror();
}