What is JSON

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ก.ย. 2024
  • Link for all dot net and sql server video tutorial playlists
    www.youtube.co...
    Link for slides, code samples and text version of the video
    csharp-video-tu...
    Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our TH-cam channel. Hope you can help.
    / @aarvikitchen5572
    In this video we will discuss
    1. What is JSON
    2. JSON Arrays
    3. Nested JSON object
    What is JSON
    JSON stands for JavaScript Object Notation. JSON is a lightweight data-interchange format. JSON is an easier-to-use alternative to XML.
    Creating a JSON object : Employee data can be stored in a JSON object as shown below.
    var employeeJSON = {
    "firstName": "Todd",
    "lastName": "Grover",
    "gender": "Male",
    "salary": 50000
    };
    1. employeeJSON is a JSON object
    2. In the curly braces we include the "name": "value" pairs, separated by commas
    3. The name and value of a property are separated using a colon (:)
    4. You can declare any number of properties
    If you want to represent the same data using XML, you may have XML that would look as shown below.
    <Employee>
    <firstName>Todd</firstName>
    <lastName>Grover</lastName>
    <gender>Male</gender>
    <salary>50000</salary>
    </Employee>
    Reading data from the JSON object : To read data from the JSON object, use the property names.
    var firstName = employeeJSON.firstName;
    Creating and accessing data from a JSON object
    <html>
    <head>
    <title></title>
    <script src="jquery-1.11.2.js"></script>
    <script type="text/javascript">
    $(document).ready(function () {
    // Creating a JSON object
    var employeeJSON = {
    "firstName": "Todd",
    "lastName": "Grover",
    "gender": "Male",
    "salary": 50000
    };
    // Accessing data from a JSON object
    var result = '';
    result += 'First Name = ' + employeeJSON.firstName + '<br/>';
    result += 'Last Name = ' + employeeJSON.lastName + '<br/>';
    result += 'Gender = ' + employeeJSON.gender + '<br/>';
    result += 'Salary = ' + employeeJSON.salary + '<br/>';
    $('#resultDiv').html(result);
    });
    </script>
    </head>
    <body style="font-family:Arial">
    <div id="resultDiv"></div>
    </body>
    </html>
    JSON Arrays : What if you want to store more than one employee data in the JSON object. This is when JSON arrays can be used. A JSON array can contain multiple objects.
    To create a JSON array
    1. Wrap the objects in square brackets
    2. Each object must be separated with a comma
    Creating a JSON array
    var employeesJSON = [
    {
    "firstName": "Todd",
    "lastName": "Grover",
    "gender": "Male",
    "salary": 50000
    },
    {
    "firstName": "Sara",
    "lastName": "Baker",
    "gender": "Female",
    "salary": 40000
    }];
    Reading from a JSON array : To access the employee objects in the JSON array, use the object's index position.
    Retrieves the lastName of first employee object in the JSON array
    var result = employeesJSON[0].lastName;
    Retrieves the fistName of second employee object in the JSON array
    var result = employeesJSON[1].firstName;
    Nested JSON object : You can also store multiple employees in the JSON object by nesting them.
    Nested JSON object example :
    var employeesJSON = {
    "Todd": {
    "firstName": "Todd",
    "lastName": "Grover",
    "gender": "Male",
    "salary": 50000
    },
    "Sara": {
    "firstName": "Sara",
    "lastName": "Baker",
    "gender": "Female",
    "salary": 40000
    }
    };
    Retrieves the gender of employee Todd
    var result = employeesJSON.Todd.gender;
    Retrieves the salary of employee Sara
    var result = employeesJSON.Sara.salary;
    In our upcoming videos we will discuss where we could use JSON formatted data.

ความคิดเห็น • 44

  • @dollybodgal2077
    @dollybodgal2077 8 ปีที่แล้ว +5

    Your All Tutorials are the best. The way you describe the concepts is just Incredible ! I am just Addicted to your voice.

  • @ConaxHateGG
    @ConaxHateGG 9 ปีที่แล้ว +10

    Lovely. Been waiting for you to provide jQuery tutorials, as you are one of the best tutor on programming subjects in TH-cam. Thank you for helping the community.

    • @ww1flyingace263
      @ww1flyingace263 ปีที่แล้ว

      He is not "one of the best", he is the best!

  • @VVR360Comedy
    @VVR360Comedy 8 ปีที่แล้ว +1

    God!! Life Saver!! Kudvenkat sir !!! the great tutorials !!

  • @ShaioteKlata
    @ShaioteKlata 7 ปีที่แล้ว

    Thank you for sharing your knowledge! This video is incredibly concise.
    In the beginning, when you showed the comparison of JSON to HTML, that's when it all clicked in my head. What a brilliant way to layout the language for beginners like me.
    Thanks, again!

  • @sujatashyam6797
    @sujatashyam6797 6 ปีที่แล้ว

    I have always liked your tutorials. They are simple and easy to understand. Thanks a lot.

  • @peterl1699
    @peterl1699 9 ปีที่แล้ว +1

    Very well explained. Thank you very much

  • @asadjaved6735
    @asadjaved6735 7 ปีที่แล้ว

    Hi Venkat, you way of explaining is very good, i benefited alot from your channel. Can we use object constructor notation to store data in json format?

  • @catsarereallycool
    @catsarereallycool 7 ปีที่แล้ว

    You're videos are excellent. Thank you.

  • @cherubin7th
    @cherubin7th 8 ปีที่แล้ว +2

    Thanks this gave me the info I needed.

  • @porkodimanickam777
    @porkodimanickam777 8 ปีที่แล้ว +3

    Hi Venkat, Thanks for your videos, I got confident to work in DOt Net because of you only. Could you please suggest me some tutorials for complete JSON.

    • @Csharp-video-tutorialsBlogspot
      @Csharp-video-tutorialsBlogspot  8 ปีที่แล้ว +4

      +Porkodi Manickam Thanks a million for taking time to give feedback. I am glad you found the videos useful.
      Sorry, at the moment I don't have any complete video tutorial specifically forJSON. I will record and upload as soon as I can. Thank you for your patience.
      Free Dot Net & SQL Server videos for web developers
      th-cam.com/users/kudvenkatplaylists?view=1&sort=dd
      If you need DVDs for offline viewing, you can order them using the link below
      www.pragimtech.com/Order.aspx
      Code Samples, Text Version of the videos & PPTS on my blog
      csharp-video-tutorials.blogspot.com
      Tips to effectively use our channel
      th-cam.com/video/y780MwhY70s/w-d-xo.html
      Want to receive email alerts, when new videos are uploaded, please subscribe to our channel using the link below
      th-cam.com/users/kudvenkat
      Please click the THUMBS UP button below the video, if you think you liked them
      Thank you for sharing these links with your friends
      Best
      Venkat

  • @hassanrahman690
    @hassanrahman690 7 ปีที่แล้ว

    Hello Venkat, It's Really useful all of your videos, i enjoyed that i couldn't find my last 4 year Bachelor degree .... it will be great if you make some tutorial on Data Structure or some algorithm like Genetic, searching , or even sentimental analysis i don't find any good tutorial on this topics.. thanks in advanced

  • @DhavalPatel-uy5xm
    @DhavalPatel-uy5xm 7 ปีที่แล้ว

    Thanks for sharing knowledge, we are still waiting for json complete tutorial, can u please upload it sir.

  • @SkwidProductions
    @SkwidProductions 8 ปีที่แล้ว

    Thank you so much for this. Very useful.

  • @unknownplaylist1614
    @unknownplaylist1614 7 ปีที่แล้ว

    How would you get the "employeeJSON" length/count (in this case/video: 2) using jQuery?

  • @MayurKajaria
    @MayurKajaria 6 ปีที่แล้ว

    Hello, sir thank you for sharing all the session of asp.net mvc. It has helped me a lot. Can you please make a video on how to retrieve data from database using json as json result and json view and jquery.

  • @somannakk1501
    @somannakk1501 8 ปีที่แล้ว

    Hi , sir if i know basic Java Script & Advance jQuery is it ok , or i should know complete Java Script

  • @luckyjan2339
    @luckyjan2339 6 ปีที่แล้ว

    thank u sir your work is really great

  • @rajmukutdl
    @rajmukutdl 8 ปีที่แล้ว

    Very Nice tutorial Thanks Sir

  • @ukaszwesoowski2186
    @ukaszwesoowski2186 9 ปีที่แล้ว +1

    Just great video! thx

  • @pablokatt
    @pablokatt 7 ปีที่แล้ว

    Thanks again and again and again!!

  • @vinayvvalaboju
    @vinayvvalaboju 2 ปีที่แล้ว

    That's amazing lecture. _/\_

  • @tonyedward528
    @tonyedward528 5 ปีที่แล้ว

    How did you run JSON on port 33358 ?

  • @raniadesign57
    @raniadesign57 6 ปีที่แล้ว

    that really clear thank you for a good tutorial

    • @raniadesign57
      @raniadesign57 6 ปีที่แล้ว

      what is the ctrl+k +d , does ?

  • @imikhan83
    @imikhan83 9 ปีที่แล้ว +1

    Thnx you so much sir

  • @mahipalkamanchi
    @mahipalkamanchi 9 ปีที่แล้ว +1

    thank u sir...!

  • @sachinmandlik5315
    @sachinmandlik5315 6 ปีที่แล้ว

    How too used database in json?

  • @joe86569
    @joe86569 6 ปีที่แล้ว

    nice tutorials subbed :)

  • @developernader
    @developernader 9 ปีที่แล้ว

    Thanks Eng Venkat

  • @malharjajoo7393
    @malharjajoo7393 8 ปีที่แล้ว

    I think you have forgotten to mention a key thing - javascript object and JSON are not the same thing.

  • @ffffoundit3198
    @ffffoundit3198 9 ปีที่แล้ว +1

    maan u should do some java ee

  • @hendesebilisim
    @hendesebilisim 7 ปีที่แล้ว

    Thank you sir

  • @rajatsharma7596
    @rajatsharma7596 5 ปีที่แล้ว

    are you Indian??

  • @kodamatilavanya910
    @kodamatilavanya910 5 ปีที่แล้ว

    Thnq

  • @beatriztrujillo7861
    @beatriztrujillo7861 9 ปีที่แล้ว +4

    Why is Sara's salary less than Todd's?

    • @enerzise3161
      @enerzise3161 9 ปีที่แล้ว +12

      +Beatriz Trujillo
      Because he is a realist and not a feminist. He is appealing to a broad group of the earths population, based on his knowledge about how the earth's human population currently functions. He is not trying to use a programming lesson to appease a limited group of people with planting false notions of how it could be, or that a certain sex of the human species should stay in power.
      He is also not trying to bash Sarah or female humans as a feminist would suppose in their personal agenda driven mentality that it is what he is trying to do. He is not trying to keep the Man in power by planting false information into girls heads that they are worth less and to boys that they are worth more. This tutorial lesson is geared towards mature people who are interested in one thing, "Learning Proper Programming Skills".
      Most people would trust a programmer that is a purist in their thinking to be a single minded programmer who has no hidden agenda and has a sole interest in teaching their skills to someone who has the desire to better their skills to be better at their hobby or job.
      You have not exposed some female Sexist who should have sacrificed the integrity of his way of teaching to push a humanist agenda to the next generation. You have succeeded in showing you have the ability to loose focus on the subject at hand. Human Agendas do not pay bills for the majority of the human race, not now or ever. Human agendas destroy lives. You can go through history and see the devastation brought on by people with Humanist Agendas.
      Besides, with the way thinking like that is, both sides end up in hatred of each other for the sake of their own gain. If a feminist were doing the tutorial and were slipping in feminist agendas, it could have validly been posed, "Why is Todd making less than Sarah?" That is by the Feminist/Sexist way of thinking.
      You do know that your question is the question you asked is a Sexist question, don;t you? A person who is Pro-Sex is a Sexist. This means if someone prefers to see the female agenda pushed is a Sexist. A person who wants the Male agenda pushed is a Sexist. They are each a side of the same crappy coin that holds no value to the human race.
      It is like the woman who tried to tell me once, "I can not be a racists, I am a black woman". She was so blinded by her Agenda, that she could not see that her statement made her guilty of racism. In other words, you question is based on sex when sex is not what the programming video tutorial is about. That makes it a Sexist Question.
      My wife makes over $50,000 a year and I am a stay at home father. I home schooled our daughter and two sons. All three went on to college and each received two degrees. Our daughter graduated high school with Honors but our two boys did not. Our daughter started college in the tenth grade, our two sons did not. One of our sons was offered a job to work for the City when he was in the ninth grade, when he was in the tenth grade and in the eleventh grade. Our other son left the eleventh grade with a 3.85 GPA to take his GED and start college with his two siblings and mother. I am a ninth grade drop out. I am not the most important in the family because I am a male. I only happen to be a male, yet I am the one who keeps everyone on track, pays the bills and cooks the meals.
      We taught our kids the truth about Human Agendas and to be very distrustful of people who push Human Agendas. I am sorry someone did not teach you the truth from a very young age, but it is never to late for a misinformed person to right the wrongs going on inside their head. We have a saying on our family, "If everyone gets to push their way, everyone gets nothing but hatred, vitriol and distrust so it is better for everyone to think more highly of others than themselves."

    • @rahul4u18611
      @rahul4u18611 8 ปีที่แล้ว +1

      +enerZise LOL!!! This is calld some kick ass reply. :D :D +1

    • @briguy9915
      @briguy9915 7 ปีที่แล้ว

      I was hoping someone asked this dumb question just so I could read an awesome reply like yours :)

    • @vmohakrish
      @vmohakrish 7 ปีที่แล้ว

      same here :)

  • @Fox64
    @Fox64 8 ปีที่แล้ว +3

    Why does Sara make so much less than Todd? haha, jk thanks for the tutorial, was good