Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6681517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:35:57+00:00 2026-05-26T04:35:57+00:00

I have following JSON string returned to a page. {firstName:Bob,lastName:Gates,department:Tech} I would like to

  • 0

I have following JSON string returned to a page.

{“firstName”:”Bob”,”lastName”:”Gates”,”department”:”Tech”}

I would like to display properties values in a page but I’m having problem.

Here is my jquery ajax

function BuildTable(msg) {
           var Person = msg[0];
            var table = '<table><tr><td>' + person.firstName + '<td><tr></table>'
            $("#temp").html(table);
        };

  $.ajax({
                type: "POST",
                url: "../test/json.aspx/testjson",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (msg) {
                    BuildTable(msg.d);
                }
            });

This returns “undefined” although I see JSON string in Firebug.
I can return JSON string by using “msg” instead of “Person.firstName”

How do I display property values in JSON string?

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:35:57+00:00Added an answer on May 26, 2026 at 4:35 am

    A couple things here that seem wrong

    1. you are doing msg.d, however the returned json object doesn’t have a property named ‘d’.

    2. once you pass in msg.d into your BuildTable function you try to use it as an array.

    3. you declare a Person object and then try to reference “person” with lowercase this is also incorrect since js is case sensitive.

    UPDATE:

    function BuildTable(msg) {
            var person = jQuery.parseJSON( msg );
            var table = '<table><tr><td>' + person.firstName + '<td><tr></table>'
            $("#temp").html(table);
        };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have the following JSON string returned from server: { response:{ imageInstances:{ one:{
I have the following json returned string: [{status:2,id:-1,content:User has entered wrong input,time:1346765646202}] (as you
Ok, a little new to JSON format.. I have the following JSON string returned
I have the following JSON String { name:Product, properties: { id: { type:number, description:Product
I have the following JSON string (from wikipedia http://en.wikipedia.org/wiki/JSON ) { name:Product, properties: {
I have the following almost JSON string: <?php $string = '{0:{id:1,name:Antiek en Kunst,subs:[{id:2,name:Antiek |
I have a variable that contains the following JSON string: { 0 : Jun
I have a JSON string as the following; { 1: { name: Jerry, age:
I have used following code to convert string to json and parse it. String
I have converted my Datatable to json string use the following method... public string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.