// 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
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😇😇😇😇
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.
THIS IS THE BEST TUTORIAL IN UA-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
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😇😇😇😇
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.
I really enjoy the way you explain how you are writing the code and why. Very informative and you make it intuitive. Great work!
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
using the pokemon api was a good choice for a introduction to fetch
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.
THIS IS THE BEST TUTORIAL IN UA-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.
i really enjoy all of your videos bro, you helped me a lot with this course, thank you!
Psd: lucario is my fav pokemon
Very good explained! thanks!
Amazing tutorial I’m gonna try this, style it nicely and flex on my class lmaooo
To be honest I was about to look for JavaScript form, about fetching and yes good counter I found this video xD
definitely the best explanation I've ever watch
This bro is a HERO!!! 🔥🙏🙏👏👏👏👏
groudon the goat honorable mention rayquaza
Thanks for the help! Got everything working on my weather project now I just need to finish the CSS
If she aint into me like he is into Typhlosion, I don’t want it!
very good, liked!
thanks, this video was super useful 😀
if you can please do axios video also and how to handle express error objects meaningful status code error massages in real world app
i watch many tutorials on this topic but didn't understand it thanks for your video now i am finally understand it
cool thanks you make it so easy
You will make node is course?
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
Alternative Title :- Bro Code flexing his knowledge about pokemon's.
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
Please teach us lua in 2024!!! thanks for your content
Ty trainer 😊
The broest Bro I've ever had
the things i need right on time 😊😊
thank U to much Mr.Pokemon🔥❤🔥
good tutorial 👍
THANKS
awesome, thanks bro 💕
Code bro react bro.... My life bro.... My heart bro.... Plz bro do bro......
Thanks Bro
amazing tutorial man thanks
it was amazing
So nice
hey, can u do a ruby course ? pls
This comment was automated
perfect! Bro Code
Super helpful
Hi bro, are you going to do a go course in the future?
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.
Thank you!
cool
👍👍👍
minun!
Oh my god....what were the chances....even typhlosion is my favourite pokemon...
my favorite pokemon is breloom I like using him to kidnap other pokemon
NodeJS course pls
Make on lua pls
should we not add an else block after checking response.ok property?
Favorite Pokemon: Lugia
Do python next😢
hello bro will their be any more videos on React JS?
Dragonite :D
is it possible to do sorting
bro please do php crud operation video please make as soon as possible
Sir bro node js please
2:15
I wont text generating logo with AI
#utorial XD
Lucario
from today pikachu
charizard
(y) (y)
thank you for your video
well said , i feel the same .
👍👍👍👍
Keep the good work up!
It would be so appreciated if you did a beginner course on Rust
all love
My favorite pokemon is jequavius
Quite not fair for a very basic and general video got such views.
are you able to teach php and sql
awesome explanation
SpongeBob is still not a Pokemon lol 😂
I LOVE YOU BRO CODE 🤩🤩🤩
THANKS BRO!!!🙌🙏🙏
Cool
loved the content man.
I wish I found Bro Code earlier in my ‘teaching myself to code’ journey
How can i access object in an api and display on html I'm getting type error 😢
definitely geodude. Thanks for making this fun.
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
Question: what if we would not prefer to use async and await? how do we display the image with the fetch?
This was a better explanation of fetch then the shit they have on codecademy
just finished every tutotial in this playlist
I really thank you for your on-point tutorial really helping me advance my lil skills
Thank you very helpful.
Kotlin or Golang course please.
Thanks bro.nice 😊😊😊😊😊 tutorial
super explanations bro
This guy is a legend
thank you alot