javascript - How to show HTML received after POST? -
maybe that's easy, cannot find solution. have endpoint, accepts post requests specific values , returns html. how should request show received html in browser?
in simple english, i'd have <a>
tag, specified http method, headers etc. used during clicking on it.
this 1 way it.
fetch(url) .then(res => res.text()) .then((html) => { // change content of element html received el.innerhtml = html // append html body document.body.innerhtml += html; })
Comments
Post a Comment