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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T16:47:24+00:00 2026-05-14T16:47:24+00:00

TLDR: Started with this question simplified it after got some of it working and

  • 0

TLDR:

  1. Started with this question simplified it after got some of it working and continuing it here.
  2. I need to ‘GET’ the JSON array
  3. Format it correctly and for each within the array place it in the corresponding DIV.
  4. ??
  5. It works.

This is a followup from this question to simplify and continue.

I need to some complicated JSON data from an array. With it I need the title and it’s value. The reason why I am doing this is because I will know what the array is called but not the data that is being generated inside it.

Lets say this new array looks as follows:

{
  "Days": [{
      "day": "Sunday",
      "time": "10.00"
    },
    {
      "day": "Monday",
      "time": "12.00"
    },
    {
      "day": "Tuesday",
      "time": "09.00"
    },
    {
      "day": "Wednesday",
      "time": "10.00"
    },
    {
      "day": "Thursday",
      "time": "02.00"
    },
    {
      "day": "Friday",
      "time": "05.00"
    },
    {
      "day": "Saturday",
      "time": "08.00"
    }
  ]
}

Fixed thanks to (Matthew Flaschen)

I would need it to get Sunday & 10.00 as well as the same for all of the others.

My code to parse this at the moment is as follows:

$.getJSON(url,
  function(data) {
    $.each(data, function(i, item) {
      $('.testfield').append('<p>' + item + '</p>');
    });
  });

Without the added times on each date it will parse the data as follows:

Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday

With the times added to the days in the array Firebug no longer recognizes it as a JSON string. So I am guessing I have formatted something wrong here. Also, I need each day & time to be on a new line I thought that

$('.testfield').append('<p>' + item + '</p>' + '<br />');

Would have applied each one to a new line but that did not work.

  1. How do I get each day or item to be on a new line?
  2. How do I get the $getjson to parse the data correctly day and its value, into a div?
  • 1 1 Answer
  • 3 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-14T16:47:25+00:00Added an answer on May 14, 2026 at 4:47 pm

    Try this (reformatted JSON – next time check your JSON with JSONLint):

    {
        "Days": [
            {
                "Sunday": "10.00",
                "Monday": "12.00",
                "Tuesday": "09.00",
                "Wednesday": "10.00",
                "Thursday": "02.00",
                "Friday": "05.00",
                "Saturday": "08.00" 
            }
        ]
    }
    

    Script to work with it:

     $.getJSON( url, function(data){
      $.each(data.Days[0], function(key,value){
       $('.testfield').append('<p>' + key + ' : ' + value + '</p>');
      });
     });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Since I got TLDR (too long didn't read) comments, I stripped 90% of this
TLDR I need to change a javascript variable on the same page after clicking
TLDR; this is not a well-phrased question, so you should probably not bother with
TLDR Version: I need to find a way to implement some sort of MessageCenter
TLDR I want to add some dynamic content into an Ext-JS window / popup.
So here is the story. I have this device that uses Linux and more
I'm at my wits end with this Java Bridge, after trying to force it
TLDR : How do I get CapsLock to translate to ShortNameDelimiter in Mma 7?
I am following some beginner tutorials for OpenGL in c++ but as I started
TLDR ; I need simple a Python call given a package name (e.g., 'make')

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.