// fetch = Function used for making HTTP requests to fetch resources. // (JSON style data, images, files) // Simplifies asynchronous data fetching in JavaScript and // used for interacting with APIs to retrieve and send // data asynchronously over the web. // fetch(url, {options}) async function fetchData(){ try{ const pokemonName = document.getElementById("pokemonName").value.toLowerCase(); const response = await fetch(`pokeapi.co/api/v2/pokemon/${pokemonName}`); if(!response.ok){ throw new Error("Could not fetch resource"); } const data = await response.json(); const pokemonSprite = data.sprites.front_default; const imgElement = document.getElementById("pokemonSprite"); imgElement.src = pokemonSprite; imgElement.style.display = "block"; } catch(error){ console.error(error); } } Document Fetch Pokemon
@talebmine65627 ай бұрын
Thanks, can you help me? I want the code to give me the logo
@Smurfis5 ай бұрын
I learn by using fun projects perhaps you could teach us how to make a little button based two player react game with this or something bro?
@Smurfis5 ай бұрын
Have always loved your videos thanks for this one particularly cos it’s exactly how I learn constants down, if not statement down variables being called down it’s sick thank you
@coding62916 күн бұрын
Fun Tutorial, really enjoyed it! Using Pokemon made it so much better than some other boring data.
@alextruong18267 ай бұрын
thank you for your video
@ay111nbg66 ай бұрын
well said , i feel the same .
@AyandaGumede-q5t10 ай бұрын
From the buttom of my heart, and on behalf of everyone. i would like to thank you so much bro….. been struggling for months with this!!!😭❤️🙏🏾. Hoping to receive a reactJS one. Once again, thank you.
@ShortSnickers10111 ай бұрын
Not only a progammer but also a pokemon fan.
@Th3Coder10 ай бұрын
Same 🙂
@alternate_fantasy7 ай бұрын
So what ?
@diegocamacho60607 ай бұрын
@@alternate_fantasy ur mom
@alternate_fantasy7 ай бұрын
@@diegocamacho6060 dont be sad kid :( im sorry for your life
@diegocamacho60607 ай бұрын
@@alternate_fantasy ur mom
@NiceChange4 ай бұрын
I really enjoy the way you explain how you are writing the code and why. Very informative and you make it intuitive. Great work!
@bekay76635 ай бұрын
using the pokemon api was a good choice for a introduction to fetch
@abinayag40509 ай бұрын
in my bottom of the heart i really appreciate you. here lot of middle class student like me. your tutorial helped me alot without any fee. thanks keep going. i expected more tutorial from you😇😇😇😇
@falakchudasama9746Ай бұрын
Perfect tutorial, perfect teaching, perfect free api
@kopilkaiser8991Ай бұрын
Thank you BroCodez! You are an angel to us new programmers 😊. I am sure all the newcomers will find this video extremely helpful 👍🏼
@Vincent_1277011 ай бұрын
this isn't included in your full Javascript course but i appreciate your efforts for doing it seperate
@TheBlueDude7111 ай бұрын
His full Javascript course was made awhile ago, this is a new updated version of that course.
@RJ1007 ай бұрын
bro you're a legend. thank you for making code easier to learn.
@eusoumateusrocha8 ай бұрын
THIS IS THE BEST TUTORIAL IN KZbin ABOUT THIS. And my favorite pokemon is cyndaquil so when you said Typhlosion I was like whaaaaaaaaaaaaat! What are the odds? hahaha
@underwhip5Ай бұрын
That typhlosion endpoint did not age well. If you know you know
@numberonemathlete303829 күн бұрын
waiting for this lol
@emir-mu1bs5 ай бұрын
definitely the best explanation I've ever watch
@muhammadshazeel5678 ай бұрын
i watch many tutorials on this topic but didn't understand it thanks for your video now i am finally understand it
@user-lx8mh3 ай бұрын
Thanks for the help! Got everything working on my weather project now I just need to finish the CSS
@larvey_5 ай бұрын
I really thank you for your on-point tutorial really helping me advance my lil skills
@uwayss_113 ай бұрын
This bro is a HERO!!! 🔥🙏🙏👏👏👏👏
@JorgeHernandez-fo5kl11 ай бұрын
i really enjoy all of your videos bro, you helped me a lot with this course, thank you! Psd: lucario is my fav pokemon
@moeyk979 ай бұрын
Amazing tutorial I’m gonna try this, style it nicely and flex on my class lmaooo
@nicktorius89103 ай бұрын
just finished every tutotial in this playlist
@andrisalazar75652 ай бұрын
Very good explained! thanks!
@danielwolks84945 ай бұрын
This was a better explanation of fetch then the shit they have on codecademy
@drewxx852711 ай бұрын
To be honest I was about to look for JavaScript form, about fetching and yes good counter I found this video xD
@vaibhavagarwal14795 ай бұрын
Alternative Title :- Bro Code flexing his knowledge about pokemon's.
@HuracanSeneca11 ай бұрын
If she aint into me like he is into Typhlosion, I don’t want it!
@CôngVinhPhạm-e6o17 күн бұрын
So great
@SafiAbdulWajidАй бұрын
awesome explanation
@vallunacoder.wecodetogether9 ай бұрын
Bro I made it 🤩🤩🤸♀🤸♀, the think is I just want to keep watching your videos. I thought I would never understand Java script.Hopefully this year I'm going to be able to make it! Send you a hug!
@4soulsz11 ай бұрын
PERFECT TIMINGGGG THANK YOUUUUUU
@memeingthroughenglish72215 ай бұрын
definitely geodude. Thanks for making this fun.
@regilearn21385 ай бұрын
if you can please do axios video also and how to handle express error objects meaningful status code error massages in real world app
@addyjaime4656 ай бұрын
This guy is a legend
@2faststudios5714 ай бұрын
thanks, this video was super useful 😀
@kyleshivers11 ай бұрын
I wish I found Bro Code earlier in my ‘teaching myself to code’ journey
@gibbaren255211 ай бұрын
Keep the good work up! It would be so appreciated if you did a beginner course on Rust all love
@fume69709 ай бұрын
The broest Bro I've ever had
@nicktorius89103 ай бұрын
groudon the goat honorable mention rayquaza
@tthamil4 ай бұрын
super explanations bro
@ofekcohen655911 ай бұрын
You will make node is course?
@MatheusFix11 ай бұрын
Please teach us lua in 2024!!! thanks for your content
@shaw8484 ай бұрын
good tutorial 👍
@ajayxoxo11 ай бұрын
the things i need right on time 😊😊
@r-i-ch4 ай бұрын
Great stuff. 2questions - is using the straight form data a security risk from injection attacks? How would you stop and abort or prevent too many requests at once?
@lolxnn3 ай бұрын
For XSS make sure that you don't use innerHTML for inserting data in the DOM. You can use innerText or setHTML if you need to insert html as setHTML sanitize the input
@lounes03b997 ай бұрын
thank U to much Mr.Pokemon🔥❤🔥
@MiriamGordilloChavez7 ай бұрын
Question: what if we would not prefer to use async and await? how do we display the image with the fetch?
@princesstechideas5 ай бұрын
Thanks bro.nice 😊😊😊😊😊 tutorial
@rahimrahim27204 ай бұрын
cool thanks you make it so easy
@luizhqdo2 ай бұрын
very good, liked!
@raghabpandit26106 күн бұрын
TypeError: Cannot read properties of undefined (reading 'front_default')
@Elexir.18911 ай бұрын
I LOVE YOU BRO CODE 🤩🤩🤩
@haniehsolatpour89456 ай бұрын
So nice
@SushiK994Ай бұрын
thank you man
@Mr_hinch3 ай бұрын
THANKS BRO!!!🙌🙏🙏
@valenciawalker64988 ай бұрын
Thank you very helpful.
@l213dhanesh311 ай бұрын
Code bro react bro.... My life bro.... My heart bro.... Plz bro do bro......
@watashiaashishgurung2 ай бұрын
Ty trainer 😊
@2ameridiem8 ай бұрын
should we not add an else block after checking response.ok property?
@QuadriCSGO9 ай бұрын
amazing tutorial man thanks
@zyntaXmods10 ай бұрын
How can i access object in an api and display on html I'm getting type error 😢
@Blitz61wasd11 ай бұрын
Cool
@nopass624711 ай бұрын
awesome, thanks bro 💕
@پارساچاوشی-ب8خ11 ай бұрын
it was amazing
@BijouBaksonАй бұрын
Thank you
@aley68111 ай бұрын
Hey Bro, this question has actually nothing to do with this video but I’ve got a project where I have to implement the best move of the computer in the game TicTacToe. I just started to learn java but that’s quite hard. Do you have some tips for me? The computer has to try to defeat me and block me by placing the symbol to places wherever I could win. I hope that you will answer. Hava a nice day.
@shafiulAlamShafi10 ай бұрын
Super helpful
@_4p_Ай бұрын
👍thanks man
@marouanebr4097 ай бұрын
👍👍👍👍
@HammerBummer-ro9ik3 ай бұрын
perfect! Bro Code
@erialgumacoisa10 ай бұрын
Thanks Bro
@_____vieve2 ай бұрын
THANKS
@lakivicsa9 ай бұрын
Thank you!
@doronfeldman515210 ай бұрын
Hi bro, are you going to do a go course in the future?
@parikshitkolhe32958 ай бұрын
Oh my god....what were the chances....even typhlosion is my favourite pokemon...
@programmated_brian11 ай бұрын
loved the content man.
@ghost.-.129011 ай бұрын
cool
@sr.pinheiro638611 ай бұрын
hey, can u do a ruby course ? pls
@weemarb10 ай бұрын
my favorite pokemon is breloom I like using him to kidnap other pokemon
@maxknight854211 ай бұрын
are you able to teach php and sql
@muhammadyousaf28769 ай бұрын
thank you alot
@minh3556 ай бұрын
For the first part, are the html and css files empty? I would assume so, but then how do you run JS in the console
@IAmNOTTHEBODYАй бұрын
By running the code and looking at the responses the console gives in your browser or vscode
@feelthesurge100311 ай бұрын
hello bro will their be any more videos on React JS?
@erialgumacoisa10 ай бұрын
NodeJS course pls
@belgian_wolvie88752 ай бұрын
My favorite pokemon is jequavius
@sebs1782 ай бұрын
minun!
@harbirdhillon81956 ай бұрын
Favorite Pokemon: Lugia
@youngtrouble0011 ай бұрын
Do python next😢
@eagledeluxe82611 ай бұрын
Make on lua pls
@alternate_fantasy7 ай бұрын
Quite not fair for a very basic and general video got such views.
@talebmine65627 ай бұрын
I wont text generating logo with AI
@JuanRobertoDejon-t6d11 ай бұрын
Dragonite :D
@manueljoseph35287 ай бұрын
is it possible to do sorting
@Dhanasekar-l4t11 ай бұрын
bro please do php crud operation video please make as soon as possible