POST Form Data as JSON with Fetch API in JavaScript

  Рет қаралды 63,474

ByteGrad

ByteGrad

Күн бұрын

Пікірлер: 51
@ByteGrad
@ByteGrad 2 жыл бұрын
Hi, mastering JavaScript is critical if you want to be a modern, professional developer: www.udemy.com/course/professional-javascript-course/?referralCode=0C1D5752923168BC87C2 Also, if you are a front-end developer then mastering CSS (including Flexbox, CSS Grid, etc.) is equally important: www.udemy.com/course/professional-css/?referralCode=4C3C08E82629E6B15752
@wickedclamor4882
@wickedclamor4882 Жыл бұрын
First time on your channel but I liked it from the start. Great quality, nice audio, clear voice and content is exactly what the title says. Thank you.
@ibrohimahmadjonov6859
@ibrohimahmadjonov6859 4 ай бұрын
How the page is not reloading after POST method, i cannot do that, please help
@marynakryvoruchenko1393
@marynakryvoruchenko1393 Жыл бұрын
Thanks for the video! Is there a json file that the information gets stored to so I could display it in another file?
@kavindudilshan8818
@kavindudilshan8818 9 ай бұрын
this is the best video i have fond in youtbe for JSON with Fetch API in JavaScript it is very good
@ajaygulani3086
@ajaygulani3086 Жыл бұрын
Thank you! this is exactly what I was looking for!
@Epic_StoriesByPrit
@Epic_StoriesByPrit 9 ай бұрын
can u make vedios on lua luci cause there is very rare material available one internet
@seekknowledge1928
@seekknowledge1928 18 күн бұрын
Sir you explain very well. I am amazed. ❤
@edwintjoa6099
@edwintjoa6099 2 жыл бұрын
Thanks for your video, you made it so easy to understand and implement.
@gunnarvispoel581
@gunnarvispoel581 Жыл бұрын
Awesome video, very clear.
@socialpeople6615
@socialpeople6615 Жыл бұрын
Thank you!!! You helped me figure out the FormData.
@koenstuurman153
@koenstuurman153 2 жыл бұрын
Hi, Thanks for the amazing tutorial. I have 1 issue, I did the exact same thing, but I get the "form.html:82 Uncaught TypeError: Cannot read properties of null (reading 'addEventListener')" error. What could be the issue here?
@ByteGrad
@ByteGrad 2 жыл бұрын
Hi, probably you didn’t select the HTML-element properly with querySelector
@koenstuurman153
@koenstuurman153 2 жыл бұрын
@@ByteGrad you're right I used id instead of class hehe. Thanks!
@mauricioknabben2793
@mauricioknabben2793 Жыл бұрын
Thank you for all! Greetings from Brasil, this video helped me a lot with a college project
@majorcodegeek
@majorcodegeek Жыл бұрын
Your video worked and so simple. Thank you so much
@sinki3322
@sinki3322 11 ай бұрын
When I try to console log my elements, it says « null » and when I try to send them to the api it says « failed to load resource: server responded with 401 ». Do you have ideas on how I could fix it ? Thank you for your video
@jayroo10
@jayroo10 Жыл бұрын
Hi, are you on UpWork by any chance? as i am trying to fix a piece of code, that needs a "save post" button on the front end, to save response text into a post, it supposed to be straight forward, but I am having trouble with the authenticity token I think, which wont allow the submission to go through. Is there any way to get your help? do you do that kind of thing? thank you
@ByteGrad
@ByteGrad Жыл бұрын
Hi, sorry am completely swamped with work atm
@jayroo10
@jayroo10 Жыл бұрын
@@ByteGrad No worries, and thanks for your reply.
@igorvenancio5899
@igorvenancio5899 Жыл бұрын
You're a really good teacher. Thanks
@HarisSohail-q4q
@HarisSohail-q4q Жыл бұрын
Man. I am seeing you the first time, and I think you have brilliantly explained the concept. Awesome 💯
@032_jatingaur7
@032_jatingaur7 Жыл бұрын
awesome bro💯
@metifu
@metifu 11 ай бұрын
what about only specific form elements only like "user name" "terms of condition" for the Object?
@mikempaka6269
@mikempaka6269 11 ай бұрын
Hi ByteGrad, I'm trying to Post from my Api I created in locahost and I have an '''error of SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data". Can it be possible to Post also in API in localhost?
@iv4nschneider
@iv4nschneider 11 ай бұрын
Amazing explanation !!! Thank you.
@Farid9086
@Farid9086 5 күн бұрын
Thank you so much my brother ❤
@narendrapatil8407
@narendrapatil8407 Жыл бұрын
Thank you it helped me in my project
@MohammadhasanAbbasi
@MohammadhasanAbbasi Жыл бұрын
thank you very much for this video
@sachinvarma9949
@sachinvarma9949 9 ай бұрын
Thank you so much brotherrr
@troymelok831
@troymelok831 Жыл бұрын
Hi, thanks for sharing. I don´t understand why is needed to convert to json if we can send FormData directly and then in the php file get data with POST if we use this method to send of course
@yeonjoon6637
@yeonjoon6637 Жыл бұрын
Hiii the url u r giving how do I identify how can provide that url!?? Which url nd how can provide it crtly!?
@sharathkk1807
@sharathkk1807 Жыл бұрын
thank you so much sir .
@selsabildjazouli7486
@selsabildjazouli7486 Жыл бұрын
that was soo helpful, thank you
@brains4043
@brains4043 7 ай бұрын
hi! theme name?
@aromalunnikrishnan161
@aromalunnikrishnan161 Жыл бұрын
Thank you sir
@muhamadrifqi2612
@muhamadrifqi2612 Жыл бұрын
Hi, Thank you so much for the amazing tutorial. I have 1 issue, I did the exact same thing, but I get the "crbug/1173575, non-JS module files deprecated." then the page is not working. What could be the issue here?
@Hrit
@Hrit Жыл бұрын
Thanks for such a clear explanation!
@StephaniePena-wq3pe
@StephaniePena-wq3pe Жыл бұрын
Does this code works if I want to make a form that has to use json information ?
@MarcelReig
@MarcelReig Жыл бұрын
Thanks, good video!
@derrickk2916
@derrickk2916 Жыл бұрын
Very helpful!
@sumith
@sumith Жыл бұрын
very usful
@Onesmo
@Onesmo 7 ай бұрын
thank you so much
@JoaqoCR7
@JoaqoCR7 Жыл бұрын
Nice video bro!
@valdompinga
@valdompinga Жыл бұрын
What if the data to submit is an array of json's? when i send to the backend it gets there on a whole differente format and messes up everything, thank you!
@ByteGrad
@ByteGrad Жыл бұрын
Hi, I don’t know what an array of json’s. You have a code example?
@valdompinga
@valdompinga Жыл бұрын
@@ByteGrad Hello thanks for answering, my issue is that im trying to post data to a server that expects a JSON array, an exemple of it is: [{name : "Joe"},{name : "Bill"} ], i tested the endpoint using Insomnia REST, posting an hardcoded JSON array and it works fine, but on the frontend code, the js object is stored in variable because i had to do data pre propressing, so when i posted the data, i did: JSON.stringify(varWithPreprocessedJsObject). What the server recieved it would be equivalent to {[{"name" : "Joe"},{"name" : "Bill"} ]" : ''} So my question is, do identify something i did wrong? Sorry for the long text... thank you!
@ByteGrad
@ByteGrad Жыл бұрын
When you do JSON.stringify() you make it JSON format. Maybe it was already JSON format when you do JSON.stringify()? You would be doubling it
@valdompinga
@valdompinga Жыл бұрын
@@ByteGrad BRO, THAT WAS IT! Thank you so much man! Can i follow u on linkedin?
@ByteGrad
@ByteGrad Жыл бұрын
Nice. It’s a common mistake. Sorry don’t have LinkedIn
Read JSON File into HTML with JavaScript Fetch API
6:27
ByteGrad
Рет қаралды 43 М.
The selfish The Joker was taught a lesson by Officer Rabbit. #funny #supersiblings
00:12
Players vs Corner Flags 🤯
00:28
LE FOOT EN VIDÉO
Рет қаралды 78 МЛН
🍉😋 #shorts
00:24
Денис Кукояка
Рет қаралды 3,6 МЛН
Sending a form using the FormData object - JavaScript Tutorial
13:10
OpenJavaScript
Рет қаралды 40 М.
Save user form input data in a JavaScript object
7:10
OpenJavaScript
Рет қаралды 42 М.
5 JavaScript Concepts You HAVE TO KNOW
9:38
James Q Quick
Рет қаралды 1,4 МЛН
POST Form Data With JavaScript Fetch API
9:52
ByteGrad
Рет қаралды 27 М.
1.1: fetch() - Working With Data & APIs in JavaScript
15:39
The Coding Train
Рет қаралды 454 М.
How to FETCH data from an API using JavaScript ↩️
14:17
Bro Code
Рет қаралды 134 М.
POST form data using JavaScript's Fetch API
8:01
OpenJavaScript
Рет қаралды 43 М.
1.4: JSON - Working with Data and APIs in JavaScript
16:22
The Coding Train
Рет қаралды 645 М.
The BEST way to host Next.js websites
17:37
ByteGrad
Рет қаралды 48 М.
The selfish The Joker was taught a lesson by Officer Rabbit. #funny #supersiblings
00:12