What is JSON

Поделиться
HTML-код
  • Опубликовано: 9 фев 2025
  • 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 RUclips 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 9 лет назад +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 RUclips. Thank you for helping the community.

    • @ww1flyingace263
      @ww1flyingace263 Год назад

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

  • @sujatashyam6797
    @sujatashyam6797 6 лет назад

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

  • @ShaioteKlata
    @ShaioteKlata 8 лет назад

    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!

  • @VVR360Comedy
    @VVR360Comedy 8 лет назад +1

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

  • @peterl1699
    @peterl1699 9 лет назад +1

    Very well explained. Thank you very much

  • @catsarereallycool
    @catsarereallycool 8 лет назад

    You're videos are excellent. Thank you.

  • @cherubin7th
    @cherubin7th 8 лет назад +2

    Thanks this gave me the info I needed.

  • @luckyjan2339
    @luckyjan2339 7 лет назад

    thank u sir your work is really great

  • @SkwidProductions
    @SkwidProductions 8 лет назад

    Thank you so much for this. Very useful.

  • @hassanrahman690
    @hassanrahman690 8 лет назад

    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

  • @rajmukutdl
    @rajmukutdl 8 лет назад

    Very Nice tutorial Thanks Sir

  • @pablokatt
    @pablokatt 8 лет назад

    Thanks again and again and again!!

  • @raniadesign57
    @raniadesign57 6 лет назад

    that really clear thank you for a good tutorial

  • @porkodimanickam777
    @porkodimanickam777 9 лет назад +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  9 лет назад +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
      ruclips.net/user/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
      ruclips.net/video/y780MwhY70s/видео.html
      Want to receive email alerts, when new videos are uploaded, please subscribe to our channel using the link below
      ruclips.net/user/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

  • @asadjaved6735
    @asadjaved6735 8 лет назад

    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?

  • @somannakk1501
    @somannakk1501 9 лет назад

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

  • @DhavalPatel-uy5xm
    @DhavalPatel-uy5xm 7 лет назад

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

  • @unknownplaylist1614
    @unknownplaylist1614 7 лет назад

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

  • @barakudaZZZ
    @barakudaZZZ 9 лет назад +1

    Just great video! thx

  • @developernader
    @developernader 9 лет назад

    Thanks Eng Venkat

  • @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.

  • @tonyedward528
    @tonyedward528 5 лет назад

    How did you run JSON on port 33358 ?

  • @joe86569
    @joe86569 6 лет назад

    nice tutorials subbed :)

  • @vinayvvalaboju
    @vinayvvalaboju 3 года назад

    That's amazing lecture. _/\_

  • @mahipalkamanchi
    @mahipalkamanchi 9 лет назад +1

    thank u sir...!

  • @imikhan83
    @imikhan83 9 лет назад +1

    Thnx you so much sir

  • @ffffoundit3198
    @ffffoundit3198 9 лет назад +1

    maan u should do some java ee

  • @sachinmandlik5315
    @sachinmandlik5315 6 лет назад

    How too used database in json?

  • @hendesebilisim
    @hendesebilisim 7 лет назад

    Thank you sir

  • @malharjajoo7393
    @malharjajoo7393 8 лет назад

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

  • @kodamatilavanya910
    @kodamatilavanya910 6 лет назад

    Thnq

  • @rajatsharma7596
    @rajatsharma7596 6 лет назад

    are you Indian??

  • @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