// 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); } }
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
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.
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😇😇😇😇
THIS IS THE BEST TUTORIAL IN TH-cam ABOUT THIS. And my favorite pokemon is cyndaquil so when you said Typhlosion I was like whaaaaaaaaaaaaat! What are the odds? hahaha
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!
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?
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
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.
// 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
Thanks, can you help me? I want the code to give me the logo
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?
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
Fun Tutorial, really enjoyed it! Using Pokemon made it so much better than some other boring data.
thank you for your video
well said , i feel the same .
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.
Not only a progammer but also a pokemon fan.
Same 🙂
So what ?
@@alternate_fantasy ur mom
@@diegocamacho6060 dont be sad kid :( im sorry for your life
@@alternate_fantasy ur mom
I really enjoy the way you explain how you are writing the code and why. Very informative and you make it intuitive. Great work!
using the pokemon api was a good choice for a introduction to fetch
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😇😇😇😇
Thank you BroCodez! You are an angel to us new programmers 😊. I am sure all the newcomers will find this video extremely helpful 👍🏼
Perfect tutorial, perfect teaching, perfect free api
THIS IS THE BEST TUTORIAL IN TH-cam ABOUT THIS. And my favorite pokemon is cyndaquil so when you said Typhlosion I was like whaaaaaaaaaaaaat! What are the odds? hahaha
bro you're a legend. thank you for making code easier to learn.
this isn't included in your full Javascript course but i appreciate your efforts for doing it seperate
His full Javascript course was made awhile ago, this is a new updated version of that course.
i really enjoy all of your videos bro, you helped me a lot with this course, thank you!
Psd: lucario is my fav pokemon
definitely the best explanation I've ever watch
i watch many tutorials on this topic but didn't understand it thanks for your video now i am finally understand it
Amazing tutorial I’m gonna try this, style it nicely and flex on my class lmaooo
I really thank you for your on-point tutorial really helping me advance my lil skills
To be honest I was about to look for JavaScript form, about fetching and yes good counter I found this video xD
This was a better explanation of fetch then the shit they have on codecademy
This bro is a HERO!!! 🔥🙏🙏👏👏👏👏
Thanks for the help! Got everything working on my weather project now I just need to finish the CSS
Alternative Title :- Bro Code flexing his knowledge about pokemon's.
just finished every tutotial in this playlist
Very good explained! thanks!
If she aint into me like he is into Typhlosion, I don’t want it!
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!
PERFECT TIMINGGGG THANK YOUUUUUU
definitely geodude. Thanks for making this fun.
Keep the good work up!
It would be so appreciated if you did a beginner course on Rust
all love
thanks, this video was super useful 😀
This guy is a legend
awesome explanation
The broest Bro I've ever had
I wish I found Bro Code earlier in my ‘teaching myself to code’ journey
the things i need right on time 😊😊
groudon the goat honorable mention rayquaza
So great
Please teach us lua in 2024!!! thanks for your content
thank U to much Mr.Pokemon🔥❤🔥
super explanations bro
very good, liked!
cool thanks you make it so easy
That typhlosion endpoint did not age well. If you know you know
waiting for this lol
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?
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
Thanks bro.nice 😊😊😊😊😊 tutorial
good tutorial 👍
awesome, thanks bro 💕
Thank you very helpful.
I LOVE YOU BRO CODE 🤩🤩🤩
THANKS BRO!!!🙌🙏🙏
amazing tutorial man thanks
it was amazing
Code bro react bro.... My life bro.... My heart bro.... Plz bro do bro......
loved the content man.
You will make node is course?
thank you man
So nice
Oh my god....what were the chances....even typhlosion is my favourite pokemon...
Cool
Ty trainer 😊
Super helpful
👍👍👍👍
if you can please do axios video also and how to handle express error objects meaningful status code error massages in real world app
Thank you
👍thanks man
THANKS
Thank you!
Thanks Bro
my favorite pokemon is breloom I like using him to kidnap other pokemon
cool
Hi bro, are you going to do a go course in the future?
perfect! Bro Code
thank you alot
are you able to teach php and sql
hey, can u do a ruby course ? pls
minun!
My favorite pokemon is jequavius
hello bro will their be any more videos on React JS?
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.
Question: what if we would not prefer to use async and await? how do we display the image with the fetch?
Favorite Pokemon: Lugia
should we not add an else block after checking response.ok property?
NodeJS course pls
Do python next😢
How can i access object in an api and display on html I'm getting type error 😢
Dragonite :D
Quite not fair for a very basic and general video got such views.
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
By running the code and looking at the responses the console gives in your browser or vscode
TypeError: Cannot read properties of undefined (reading 'front_default')
is it possible to do sorting
Make on lua pls
2:15
from today pikachu
I wont text generating logo with AI
Sir bro node js please
SpongeBob is still not a Pokemon lol 😂
Kotlin or Golang course please.
#utorial XD
bro please do php crud operation video please make as soon as possible