function submit(result) {
    // we have to do a top-level request instead of AJAX
    const form = document.createElement("form");
    form.method = "POST";
    form.style.display = "none";

    addInput(form, "result", result)

    document.body.appendChild(form);

    form.submit();
}

function check() {
  if (isWebAuthnSupportedByTheBrowser()) {
    submit("ok");
  }
  else {
    submit("error");
  }
}

window.onload = () => {
  check();
}
