I\'m trying to fetch a file and return it\'s HTML. However it\'s not as simple as I\'d have imagined.
fetch(\'/path/to/file\') .then(function (respon
you can return the response with .text(), and then render the page in the doc as you want.
.text()
function fetchHtml() { fetch('./file.html') .then((response) => { return response.text(); }) .then((html) => { document.body.innerHTML = html }); }