0 votes
1.9k views
in JavaScript by
retagged
How to parse json in javascript? Please explain with an example.

1 Answer

0 votes
by

In the following example, you will see how to parse and get data from json. Actually i want to get "lastName" from json.

<html>
    <head>
    <title>JSON parse in javascript</title>
        <script>
            var json = '{"firstName":"Tinkku", "lastName":"Rai", "salary":7500}',
            obj = JSON.parse(json);
            alert(obj.lastName);

        </script>
    </head>
    <body>
    </body>
</html>

Share:- Whatsapp Facebook Facebook


Welcome to Developerhelpway Q&A, where you can ask questions and receive answers from other members of the community.

Categories

...