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 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})
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 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
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.
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...
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 :(
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 ^^;
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.
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.
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
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.
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~~
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
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.
Spent almost 3 days on something then watched this video and was done in less than 30mins. A really helpful video. Thanks man....
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!
3 hours searching google for a solution. Finally i find it here a solution as simple as 3 lines of code. Thanks a lot
I was stuck with JSON data not showing correctly in the DOM, this helped me a lot. Thank you.
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
Very easy to understand tutorial...I liked the way you explain stuff in a clean and professional manner
Finally! Thank You! - the best explanation out there on how to access data from json file using html and jQuery!
Thanks! Spent hours searching for a solution. Very helpful!
I agree, been struggling with that for a while but you made it super clear! thanks a lot
You have talent for explaining this material. Keep up the good work!
All day looking for the solution and it was here! Thanks a lot!
Thanks for your clear speaking and well organized tutorial. Great video!
thanks for explaining what my teacher can't
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})
Helpful tutorial and your voice is very warm sir!
Why can't every tutorial be like this. Glad i found this, thanks a lot!
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!!!
Great voice and you taught great too!
So beautifully and simply explained! AMAZING! Thank you
Excellent, now I understand it. In both methods. Thanks!
Awesome!! best way to learn basic jQuery
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
Great tutorial. Well explained. Easy to follow.
This is all lovely, but what do you do if the object contains arrays too...?
Great video. Explained so nicely with a simple example. Thank you!
Thanks a lot! It helps so much!
Good to hear!
Thank you.
How do you read JSON that is structured my month and day?
very clear--------ONE STEp at A TiMe
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
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.
Very , very helpful, easy to understand
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...
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 :(
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.
Thank you for this.
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?
Amazing tutorial, keep it up!
thank you for excellent I was struggling part I did not realized we can to put inside $(data.example).each. thank you.
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 ;)
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.
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
Good Explanation...
you're my saviour as usual :)
You are too good! Thanks this helped a lot...
Awesome video! Made concepts crystal clear. Do we compulsorily need to run this on a server?
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.
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~~
This is great!
Hi, Thanks you are the best!!, Buen trabajo amigo
thanks alot for array name articles example. All of example; basic json. Thanks.
how to output to html? thanks
you are a good man !
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 doesn't seem to work when pulling a JSON file from an external (HTTP) server. Any advice?
you would need to use JSONP
Dude great video!
OH EHM GEE my code is now WORKING FOR ME!!
data.articles give return nothing, please help
i tried the code till 3:51 it gives errors saying:
Uncaught ReferenceError: $ is not defined
would anyone help??
in HTML include JQUREY library
Thanks a lot
This helped me a lot! 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 ?!
awesome, thanks!
Nice tutorial. Thanks
thanks for your job
Great tutorial!
NIce video, i dont understand very good english but i could undesrtand u man thx
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.
Very good... you got subscribed
thank you so much, really helped
thanks lot
Hey, thanks! 😉
Thankyou
Thank you very much for this tutorial.
GOD bless you and keep you :).
it's useful for me!
tnx for uploading this video
great!!!
Muchas gracias, me ayudaste demasiado amigo (Y)
thanks alot :)
I love you
4:10 i can't do this in chrome locally. chrome is stupid.
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.
This tutorial won't work unless you're using XAMPP
Cors error
Please help
osman
Ddupfkkgkpc
kh.bkicşgchvcjgjgvjmrjnvkkşhvkv+bkg
Who here wants to learn this to get better at minecraft commands probably none of you . you probably have more important uses for it
"day-tuh"
Lame trash...