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 -

Qt QGraphicsScene is not accessable from QGraphicsView (on Qt 5.6.1) -

Python Tornado package error when running server -