3 ms·
This is the answer. You need like 3 things for this - grab data from form, send data using axios (3 lines), display the response.
by throw1234651234 4y ago
This is the answer. You need like 3 things for this - grab data from form, send data using axios (3 lines), display the response.
- lloydatkinson 4y agoWhy would axios be used for a form post over a HTML form post? Also, could you explain how sending the data to a server is the answer when OP specifically asked for a static site without a backend? You did read the question in full before deciding on the answer, I hope.
- throw1234651234 4y agoThe proposal is an alternative for quick delivery. I did read "What would be the path of least friction to produce a no-backend static website that can host these calculators? I believe that with the right intuitive UX and user-friendly features (i.e. persist the input in the URL query string, instant recomputation on input change, …) they could be valuable for someone." If he/she doesn't want to learn front end, just dumping data to an API is a workable solution. If he/she really wants to go the quoted route - sure, learn everything. Again though, SPAs are NOT a substitute for learning HTML/CSS/JS basics. At the end of the day, he has to understand that || is raw Javascript, even though it's used to render or not render. That creating a <tr> from data is actually populating a <table> that needs a <th>, etc, etc. So what we are recommending is "work around all that to your strengths". Your solution is pretty much "learn front end".
- lloydatkinson 4y agoI didn’t suggest building a SPA, though I probably would if I was making this. Astro is an example of how to build traditional multi-page site that easily loads React components.