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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:42:00+00:00 2026-05-14T15:42:00+00:00

Got the simplified array working see below Following up on the complicated array to

  • 0

Got the simplified array working see below

Following up on the complicated array to parse see here.


TLDR: Want to get each heading from an array and insert it into a div without knowing what is inside the div using Jquery – getJSON.

Edit: The data is coming from a piece of software that is outputting the JSON string every couple of seconds with new data, so I need to pull the array of data within “d” as in the example below. So i should get “Title” & “034324324”etc for each.

Edit2 Updated code to match mine exactly..

I have JSON array lets say:

{
  "Days": ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
}

And I want to parse it as for each “title” to insert it into a div.

Trying along the lines of

function getdata() {
31 $.ajaxSetup ({ cache: false}); //<!-- Stops IE from caching data //-->
32 
33 $.getJSON(testurl, function(data) {
34 $.each(data.days, function(i,item){
35 $('#testfield').append('<p>' + item + '</p>');
36
37 });
38 }); 

to no avail.

I am using Getjson in other places but in cases where I know what request I am making.
e.g:

$('#name').html(data.Projectname);

Which is all working perfectly fine but in this case I need to get the details out of the array without knowing what is inside the array I’m sure there is something simple that I’m missing here or doing wrong ^^.

The JSON I have currently been working with looks like :

{"Projectname":"ertyofhj","Projectid":"aqwertyuqw","Projecttitle":"ertyofhj"}

The array was just a way to look out pulling out the data without knowing what was inside the array.

I just keep adding more.
Debugging firebug or IE’s debugger(Aargh) it will hit

33 $.getJSON(testurl, function(data) {

then

38 });

completely skipping

34 $.each(data.days, function(i,item){

-The GET request fires fine and returns the correct JSON string. But now it will not fill the $.each, or even if I specifically ask for a certain string.
On note of above Firebug is also telling me that it isn’t formatted as JSON?

Changed the original JSON string to something simpler.(Days of the week) as is days of the week will load. So I am getting somewhere. But I need to be able to call a more complex array. For example (using the days) each day has a specific time on it that I need to display as well also each day should be on a new line tried adding in a ” + ‘< br />’ but that doesn’t work either. Displayed in an array such as:

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

And I need to pull Dayname & time for all.

  • 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-14T15:42:01+00:00Added an answer on May 14, 2026 at 3:42 pm
    $.getJSON(url,
        function(data){
          $.each(data.items, function(i,item){
          $('#testfield').html('<p>' + item.d.title + '</p>');
          });
        });
    

    In this code you’re going to end up replacing the HTML of the item with ID of ‘testfield’ with the value over and over … you might want to try using jQuery.append to add all entries as you’ve specified above

    $.getJSON(url,
        function(data){
          $.each(data.items, function(i,item){
          $('#testfield').append('<p>' + item.d.title + '</p>');
          });
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 423k
  • Answers 423k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You could use LESS, which has a border-radius example on… May 15, 2026 at 11:34 am
  • Editorial Team
    Editorial Team added an answer You do realize that indices start with zero in C#?… May 15, 2026 at 11:34 am
  • Editorial Team
    Editorial Team added an answer What comes after the ? is the query string so… May 15, 2026 at 11:34 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.