Hey Friends, like many of you, I’m fairly new to all of this. I need some help to get over a bump, so if anyone has a moment and a solution, I would like to hear from you! I have a very simple form sending a POST to remote server, which is working great! My issue is in processing the RESPONSE. On success the server responds with:
You would add something like this, by adding in the header or footer with the files name
Honestly i would think you would make the api call in js as well unless the server side or your host has a big infrastructure for that kind of thing like netlify.
Well, my understanding of this is that you can take the JSON response from a form action POST and convert that into a js string? Here’s the response I’m receiving:
I see various ways of processing the JSON, looks simple enough, into JS, but can’t find a way to take the string as displayed in the browser? Am I missing something here? I have a form POST and on success it replies with the JSON response message as shown above. Is there a method of taking it directly from the browser and working with it???
Once you learn how to do this you it will be a huge milestone, you can do so much once you can handle data from api’s so persist! You want to take data and handle it by displaying it into the dom. The browser already has access to it by the dev tools but users don’t know how to do that, so your job is to display it. This is what the javascript is for.
One method is once the data arrives you have an you tell js where to put the data. You have a hidden invisible div with a class of lets say data. Then tell js to put form data into a paragraph inside the div called data.
Document.query.selector(“.div”) something like this i’m riffing it. Then you pass it the json data you give a varable name to.
Take it step by step, can you console log the data, can you select a div, can you add static data to that div. Then put it all together.