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

Popular posts from this blog

angular - DownloadURL return null in below code -

meteor - inserting data to database gives error "insert failed: Method '/texts/insert' not found" -