I need to get data from the form fields and input it into the fetch to post the data to the site, that's why I use the last example code block and I forget to explain it. I love the simplicity of your code and its a good way to show the examples, clean, thank you
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I love the fetch() api. It's really great and makes async calls so much easier than in past with xhr. I tried your code from the browser console.
Here's one that you can try in the browser console (F12).
Just copy and paste into the console and hit ENTER.
Also, if you change that response.text() to response.json() you get a nice JSON object back.
I need to get data from the form fields and input it into the fetch to post the data to the site, that's why I use the last example code block and I forget to explain it. I love the simplicity of your code and its a good way to show the examples, clean, thank you