In this video we will talk about JSON, JavaScript object literals and AJAX. Ill show you how to create JSON objects and arrays and also how to make an Ajax request to a .json file
CODE: Code for this video
http://traversymedia.com/downloads/json_sandbox.zip
EDUONIX COURSES: Please use affiliate links from website below
http://www.traversymedia.com/eduonix-courses
SUPPORT: We spend massive amounts of time creating these free videos, please donate to show your support:
http://www.paypal.me/traversymedia
http://www.patreon.com/traversymedia
FOLLOW TRAVERSY MEDIA:
http://www.facebook.com/traversymedia
Tweets by traversymedia
http://www.linkedin.com/bradtraversy
Original source
31 responses to “JSON Crash Course”
Brad the great
Very easy to understad , this video was very helpful to me. thanks
It is a really good and quick reference, got to know about live-server too, thanks
Your explanations are so clear! Keep up the good work! Comprehensive content Thanks
Fantastic video, thank you so much.
Terrific explanation! Thanks so much.
how are you using ls command in windows
What is that console ? Where are you getting that output of the program ? Please reply.
Thankyou 🙂
Excellent bro.
How to get the value of 3h in JavaScript ?
"rain":{
"3h":0.255 }
The funny thing is i already know maybe 70% of JSON just from MINECRAFT WTF DUDEEEE
This has been really helpful. Thank you.
As always we learn so much from you! This helped me so much in my studies.
BASONN = Booleans, Arrays, Strings, Object, Numbers, Null
(Thanks, @squibbles)
why i am studing at university, when Traversy Media is here ?
In this video we will be typing a lot of INVALID JSON and talk about javascript a lot.
thank you!
That's all ? lol I planned 1 week to learn JSON haha.
Thank you so much Brad.
Love your videos. They are very straight to the point. Good job, Brad! 🙂
Great Video. Thanks. Here you are using node.js and accessing the file from cmd. Is there a simpler way so that I can double click on the index.html file and see the output like an average user on chrome/firefox rather than accessing from cmd. If anybody could mention it would be a big help…
i get this until the part you went to json file. other than that it really is a great crashcourse. thanks
Let's say I'm using JSON files as a read-only data store of sorts. I have several MB of data that I don't want to pass over the wire all at once unless needed. I have it parsed into ~100 subdivisions of a few KB to a MB. I can have a one-page .js app pull data from these files (actually pull all the data from one whole file at a time, as demanded) based on query string and a few short look-up structures in the one page to translate the request.
Bottom line, I've got a bunch of json files. I want them to be as short as possible. I like that I can address the data when I read it in with names for the indices, like file1.person.lastname, say. But, I sure as hell don't want to write "lastname": "Smith" 500 times in the file. That wastes bandwidth. Is there a way to define a type, then instantiate it 1000 times (like in an array of that type) in the same json file without the label, but simply by order, so I can save potentially tens of KB of transmission while still using the intuitive class member naming scheme in my one page (instead of using numeric indices as I fear I might have to)? I hope this is an intuitive question and I just don't know something I should but that is never covered in tutorials.
Your video is very helpful and easy to understand. Thank you please keep share your knowledge!
Well done. I still not clear on how the ul tag gets appended with an Id of person.
<body>
<main>
</main>
<script>
let renderOrderedList = ["Alpha", "Beta", "Gamma", "Delta", "Epsilon"];
let output = ' ';
for (let i = 0; i < renderOrderedList.length; i++) {
output += '<ol>' +
'<li>' + renderOrderedList[i] + '</li>' +
'</ol>';
}
document.querySelector('main').innerHTML = output;
</script>
</body>
I have above code which is working properly but when I try to use the function it wont work. Can anyone help me to solve the below code if possible?
function renderOrderedList(){
let output = ' ';
for (let i = 0; i < renderOrderedList.length; i++) {
output += '<ol>' +
'<li>' + renderOrderedList[i] + '</li>' +
'</ol>';
}
document.querySelector('main').innerHTML = output;
}
renderOrderedList(["Alpha", "Beta", "Gamma", "Delta", "Epsilon"]);
excellent
Excellent crash course! With this, I went from no web development experience to seeing a whole world of possibility.
One of the best JSON Tutorial and one of the best JSON Parser I found is https://jsonformatter.org/json-parser
One of the best tutorial videos I've had a chance to watch and learn from. Thanks man! This 25 Minutes was really useful.
Your videos always are awesome and easy to follow up .. thank you so much bro.