diff options
-rw-r--r-- | scripts/webring.js | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/scripts/webring.js b/scripts/webring.js index 2b08b77..07e5990 100644 --- a/scripts/webring.js +++ b/scripts/webring.js @@ -1,12 +1,3 @@ -const xhr = new XMLHttpRequest(); - -xhr.open("GET", "https://aidang.cc/webring/all") -xhr.send(); -xhr.responseType("json"); -xhr.onload = () => { - if (xhr.readyState == 4 && xhr.status == 200) { - console.log(xhr.response); - } else { - console.log(`Error: ${xhr.status}`); - } -} +fetch("https://aidang.cc/webring/all", { + method: "GET" +}).then((response) => response.json()).then((json) => console.log(json)); |