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:
parent
56ea638290
commit
6dbd73d826
|
@ -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);
|
||||
});
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in New Issue