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

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -