This was the most amazing, simple and comprehensive tutorial I've ever seen! You took the time to explain what's what in the functions and worked your way from simple to more complex. Finally, a good programming teacher!! Thank you sir.
I searched and searched for ages and couldn't understand how it all worked and you taught me! Now I can consume the EIA and other API's easily, Thank you!
I keep getting this error. :( Can anyone help? "from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https."
So it appears this is due to the Chrome browser perhaps. Didn't look into it too far, but when it happened to me, I just used a JSON file that is hosted on a server. You can use PostMan if you're using API's regularly. They also provide 50+ live API sets that you can use without a key. For instance "api.zippopotam.us/us/98121" is for postal codes. Hope this helps!
@@JuanGarcia-vf9pe you need to start the chrome.exe file (which will be located somewhere in your program/google/chrome folder in windows most probably) from the command prompt with --allow-file-access-from-files
Problems is Fixed! Thank you for this wonderful tutorial! Very straight to the point and very simple which is just fine for a very freshman in AJAX like me ^^;
This isn't working for me. I just have a simple console log to print out a string and i'm not getting anything. The file seems to be there under the network tab but getJSON just doesn't work. Using jquery 1.10.0.
I get the following data, encapsulated inside the callback function, test in OpenWeather. How do I access it? test({"coord":{"lon":106.85,"lat":-6.21},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"base":"stations","main":{"temp":28.61,"pressure":1008,"humidity":88,"temp_min":25,"temp_max":32},"visibility":5000,"wind":{"speed":3.1,"deg":360},"clouds":{"all":75},"dt":1508135400,"sys":{"type":1,"id":8038,"message":0.0079,"country":"ID","sunrise":1508106650,"sunset":1508150727},"id":1642911,"name":"Jakarta","cod":200})
Hello, il have error in console : XMLHttpRequest cannot load file:///F:/formation/controle%20continu%203/continu3%20v2/questions.json. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
Thanks for the tut. This was exactly what i needed to know for our schoolproject ;) I need to use an API that outputs the data in JSON format. I've seem to get the hang of it now :D
Hello, I have one question?? I have a form with having 200 fields so how to validate this form with jquery/javascript?? we can not use var fs=document.getElementbyId('firstname'); for each field?? So how to validate it??
"Failed to load file:///C:/Project/data/hosts.json: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https." I never got off the starting line :(
You mentioned that Ajax provides more control, can you demonstrate that? Because, they both seems to work the same way...I will be glad if you can demonstrate the additional controls you get when choosing to use Ajax. Thanks
Any idea how to fix this error??? jquery-3.4.1.min.js:2 Access to XMLHttpRequest at 'file:///C:/Users.........Dict.json' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
Always enjoyed your videos. One thing I always wish you did but never wanted to bother you with it. I'll take a second to bother you with it it now though and maybe others will benefit as well. Please capture your videos into a smaller resolution desktop. Watching your videos on the iPad can sometimes be hard and on the iPhone is definitely harder to see. Thanks for all the videos
great video.. really helped.. but you're using the json in the same directory,, what if the file was in another folder.. can you still use this method? tx...
Problem appeared~~~... jquery-2.1.4.min.js:4 XMLHttpRequest cannot load file:///C:/phpStudy/WWW/catch%20it/theJason.json. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource. what should i do with this error on my computer? Thank you for your help~~
Hi Alex! Thank you for posting this video! Your tutorials have always helped me a lot! I was just wondering how would you output each JSON Object to a div in HTML? say for example inside that div, with the title of the article inside a tag and the body in a tag. Thanks!
Instead of console.log() you would say for example, $('h3').text(value.title). Same thing for the . This is if your doing it like in this tutorial. Note that looping will cause only the last values to appear inside your tags.
Hello sir, Whenever i'm trying to load a file this way, I get this error: XMLHttpRequest cannot load file:/// MYPATH.jason Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource. I dont know how to fix this. Do you know how to help me?
Remove this line, the json data will display on this line through the div class. $( ".US" ).append(value.data[0][1]); I had a multidimensional array so you can skip on the [0] and [1] if not needed. You just have to use append.
This was the most amazing, simple and comprehensive tutorial I've ever seen! You took the time to explain what's what in the functions and worked your way from simple to more complex. Finally, a good programming teacher!! Thank you sir.
This was the best explanation on the internet! Period! Thank you so much!
+Abhi Visuvasam Totally agree!
I searched and searched for ages and couldn't understand how it all worked and you taught me! Now I can consume the EIA and other API's easily, Thank you!
Spent almost 3 days on something then watched this video and was done in less than 30mins. A really helpful video. Thanks man....
3 hours searching google for a solution. Finally i find it here a solution as simple as 3 lines of code. Thanks a lot
Finally! Thank You! - the best explanation out there on how to access data from json file using html and jQuery!
I was stuck with JSON data not showing correctly in the DOM, this helped me a lot. Thank you.
Very easy to understand tutorial...I liked the way you explain stuff in a clean and professional manner
The best video explaining ajax. I have been trying for days. only now I got it. Great channel!!
This is the best video, It did what my professor and stack over flow couldn't do.
Sir you have got your self a subscriber
Thanks for your clear speaking and well organized tutorial. Great video!
I agree, been struggling with that for a while but you made it super clear! thanks a lot
Thanks! Spent hours searching for a solution. Very helpful!
I keep getting this error. :( Can anyone help?
"from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https."
Hi! have you got any solution for this error? Im stucked in the same. Thanks
So it appears this is due to the Chrome browser perhaps. Didn't look into it too far, but when it happened to me, I just used a JSON file that is hosted on a server. You can use PostMan if you're using API's regularly. They also provide 50+ live API sets that you can use without a key. For instance "api.zippopotam.us/us/98121" is for postal codes. Hope this helps!
@@JuanGarcia-vf9pe you need to start the chrome.exe file (which will be located somewhere in your program/google/chrome folder in windows most probably) from the command prompt with --allow-file-access-from-files
All day looking for the solution and it was here! Thanks a lot!
Helpful tutorial and your voice is very warm sir!
You have talent for explaining this material. Keep up the good work!
thanks for explaining what my teacher can't
Excellent, now I understand it. In both methods. Thanks!
Just the hint to output the result to console.log to reveal the structure of the returned object was worth watching. Thanks great tip for a novice!
Thanks a lot! It helps so much!
Good to hear!
Problems is Fixed! Thank you for this wonderful tutorial! Very straight to the point and very simple which is just fine for a very freshman in AJAX like me ^^;
How'd you fix the error? I'm getting the same one.
try it again on Firefox.
Why can't every tutorial be like this. Glad i found this, thanks a lot!
So beautifully and simply explained! AMAZING! Thank you
This isn't working for me. I just have a simple console log to print out a string and i'm not getting anything. The file seems to be there under the network tab but getJSON just doesn't work. Using jquery 1.10.0.
I get the following data, encapsulated inside the callback function, test in OpenWeather. How do I access it?
test({"coord":{"lon":106.85,"lat":-6.21},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"base":"stations","main":{"temp":28.61,"pressure":1008,"humidity":88,"temp_min":25,"temp_max":32},"visibility":5000,"wind":{"speed":3.1,"deg":360},"clouds":{"all":75},"dt":1508135400,"sys":{"type":1,"id":8038,"message":0.0079,"country":"ID","sunrise":1508106650,"sunset":1508150727},"id":1642911,"name":"Jakarta","cod":200})
Great video. Explained so nicely with a simple example. Thank you!
Great tutorial. Well explained. Easy to follow.
Thank you.
How do you read JSON that is structured my month and day?
thanks alot for array name articles example. All of example; basic json. Thanks.
Awesome!! best way to learn basic jQuery
Thanks a lot!!!
Great voice and you taught great too!
Very , very helpful, easy to understand
Hello, il have error in console :
XMLHttpRequest cannot load file:///F:/formation/controle%20continu%203/continu3%20v2/questions.json. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
OK en local c'est de la merde, il faut mettre les fichier sur un hébergeur et là ça fonctionne ;)
thank you for excellent I was struggling part I did not realized we can to put inside $(data.example).each. thank you.
Amazing tutorial, keep it up!
very clear--------ONE STEp at A TiMe
Thanks for the tut. This was exactly what i needed to know for our schoolproject ;) I need to use an API that outputs the data in JSON format. I've seem to get the hang of it now :D
Hello,
I have one question??
I have a form with having 200 fields so how to validate this form with jquery/javascript?? we can not use
var fs=document.getElementbyId('firstname');
for each field??
So how to validate it??
Hi, Thanks you are the best!!, Buen trabajo amigo
"Failed to load file:///C:/Project/data/hosts.json: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https." I never got off the starting line :(
You mentioned that Ajax provides more control, can you demonstrate that? Because, they both seems to work the same way...I will be glad if you can demonstrate the additional controls you get when choosing to use Ajax. Thanks
i tried the code till 3:51 it gives errors saying:
Uncaught ReferenceError: $ is not defined
would anyone help??
in HTML include JQUREY library
Awesome video! Made concepts crystal clear. Do we compulsorily need to run this on a server?
Good Explanation...
Thank you for this.
Any idea how to fix this error???
jquery-3.4.1.min.js:2 Access to XMLHttpRequest at 'file:///C:/Users.........Dict.json' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
NIce video, i dont understand very good english but i could undesrtand u man thx
This is all lovely, but what do you do if the object contains arrays too...?
Always enjoyed your videos.
One thing I always wish you did but never wanted to bother you with it.
I'll take a second to bother you with it it now though and maybe others will benefit as well.
Please capture your videos into a smaller resolution desktop. Watching your videos on the iPad can sometimes be hard and on the iPhone is definitely harder to see.
Thanks for all the videos
This is great!
great video.. really helped.. but you're using the json in the same directory,, what if the file was in another folder.. can you still use this method? tx...
you are a good man !
You are too good! Thanks this helped a lot...
This is really informative, but I get a 'Failed to load file://' error in the console with either. Any idea what I need to fix?
Problem appeared~~~...
jquery-2.1.4.min.js:4 XMLHttpRequest cannot load file:///C:/phpStudy/WWW/catch%20it/theJason.json. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
what should i do with this error on my computer?
Thank you for your help~~
Thank you very much for this tutorial.
GOD bless you and keep you :).
you're my saviour as usual :)
Hi Alex! Thank you for posting this video! Your tutorials have always helped me a lot! I was just wondering how would you output each JSON Object to a div in HTML? say for example inside that div, with the title of the article inside a tag and the body in a tag. Thanks!
Instead of console.log() you would say for example, $('h3').text(value.title). Same thing for the . This is if your doing it like in this tutorial. Note that looping will cause only the last values to appear inside your tags.
Thanks a lot
This helped me a lot! thanks : )
thanks lot
Dude great video!
OH EHM GEE my code is now WORKING FOR ME!!
Nice tutorial. Thanks
thank you so much, really helped
Thankyou
thanks for your job
awesome, thanks!
Very good... you got subscribed
Great tutorial!
This doesn't seem to work when pulling a JSON file from an external (HTTP) server. Any advice?
you would need to use JSONP
data.articles give return nothing, please help
tnx for uploading this video
how to output to html? thanks
Hey, thanks! 😉
Hello sir,
Whenever i'm trying to load a file this way, I get this error:
XMLHttpRequest cannot load file:/// MYPATH.jason Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
I dont know how to fix this. Do you know how to help me?
@Miles Falk How can I solved It ?!
it's useful for me!
Muchas gracias, me ayudaste demasiado amigo (Y)
I love you
great!!!
thanks alot :)
heey, can you please help me!
how can i insert this data into a table in html?
Remove this line, the json data will display on this line through the div class.
$( ".US" ).append(value.data[0][1]);
I had a multidimensional array so you can skip on the [0] and [1] if not needed.
You just have to use append.
you can't do this anymore you need live server to do this.
+Jason Chan I literally just did this in my browser and it works as long as the file is local.
4:10 i can't do this in chrome locally. chrome is stupid.
Cors error
Please help
osman
Ddupfkkgkpc
kh.bkicşgchvcjgjgvjmrjnvkkşhvkv+bkg
This tutorial won't work unless you're using XAMPP
"day-tuh"
Who here wants to learn this to get better at minecraft commands probably none of you . you probably have more important uses for it
Lame trash...