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 7643169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:22:50+00:00 2026-05-31T09:22:50+00:00

Json is sitting on my localhost as: /data/: { children: [ { name: analytics,

  • 0

Json is sitting on my localhost as: /data/:

{
"children": [
    {
        "name": "analytics",
        "size": "1243"
    },
    {
        "name": "math",
        "size": "4343"
    },
    {
        "name": "algebra",
        "size": "1936"
    },
    {
        "name": "calc",
        "size": "3936"
    },
    {
        "name": "geom",
        "size": "2136"
    },
    {
        "name": "Quant",
        "size": "4136"
    }
]

}

Here is how I am trying to access the json:

var interval = setInterval(function() {
        $.getJSON("http://localhost:8080/dev_tests/d3/examples/data/flare2.json", function(json) {
            $.each(json.children,function(i,name){
            alert(json.children);
            });

        });
        }, 3000);

The data comes in just fine. That is, when I run console.log(json) I can see the above json name/value txt pairs in firebug. However, before each name value pair I see the word Object. So for example instead of my log showing { name=”analytics”, size=”1243″},.. it actually shows: [Object { name=”analytics”, size=”1243″},… And that too is what my alert shows: [object Object] instead of name=”analytics”, size=”1243″.
Why is this and is there a way to get my json name/value pairs in text so that I can store as a javascript String?

Many thanks in advance.

  • 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-31T09:22:51+00:00Added an answer on May 31, 2026 at 9:22 am

    The O in JSON stands for “object.” It’s a way of serializing a JavaScript object to a string (and back). You seem to be relying on the conversion on one hand (referencing children) but not want to have the conversion done on the other hand. If you really want children to be a collection of strings in the format you describe, you should store it that way. If you really do want the object notation (and conversion to objects in the client), then you can simply use the properties of the object.

    var interval = setInterval(function() {
        $.getJSON("http://localhost:8080/dev_tests/d3/examples/data/flare2.json", function(json) {
            $.each(json.children,function(i,item){
               alert("name = " + item.name + ", size = " + item.size);
            });
    
        });
        }, 3000);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I retrieve data from my localhost as JSON everything is OK. When I
Assume I have a such json setting: { page:1, items:[ { name: 'item1', id:1
My JSON Data {menu: { id: file, value: File, popup: { menuitem: [ {value:
My App needs to connect to and grab data from a MySQL database sitting
I've got a JSON response that looks like this: { COLUMNS:[SETTING_NAME,SETTING_VALUE,COLOR], DATA: [ [setting_1,100.0,yellow],
I am having trouble setting the XHR responseType to json. It works fine if
I'm struggling in setting a function's return value to the json response of its
JSON stands for JavaScript Object Notation. But how come languages like php, java, c
Getting Json from the Server and displaying it in the grid is relatively straight
My JSON contains special characters like: new line, double quotes etc. I am creating

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.