Improve AJAX example [ci skip]

The example uses `fetch` to retrieve HTML from the server and append it to an element on the page. This commit updates the example to append the response HTML rather than the full response object.
This commit is contained in:
Calle Luks 2021-02-11 16:07:18 +01:00 committed by GitHub
parent 56ea638290
commit 6dbd73d826
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -44,7 +44,7 @@ fetch("/test")
.then((data) => data.text())
.then((html) => {
const results = document.querySelector("#results");
results.insertAdjacentHTML("beforeend", data);
results.insertAdjacentHTML("beforeend", html);
});
```