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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:35:23+00:00 2026-06-13T12:35:23+00:00

I have been using XML for a while now and have been reading about

  • 0

I have been using XML for a while now and have been reading about JSON being lighter and faster, so i am playing around with it a bit and trying to get a hang of it! the only problem is i have no idea as to how much of the syntax I’ve been using is correct.. if any one has any pointers for me it’d be really great! below is my attempt at nesting arrays and objects in json and this is my attempt at getting hold of that data also. Thanks, eggmaster

{
'page' : [{
    'article' : [{
        'block' : [{
            'title' : 'Title1-1',
            'instruction' : 'simon says',
            'body' : 'lorem dipsem ikhsduifohsdihfsjkahfksdlfklasdfh-0===-=-sklasdhjkfgaklf'
        }],
        'block' : [{
            'title' : 'Title1-2',
            'instruction' : 'simon stop says',
            'body' : 'lorem dipsem ikhsduifohsdihfsj58779kahfksdlfklasdfhsklasdhjkfgaklf'
        }]
    }],
    'article' : [{
        'block' : [{
            'title' : 'Title2-1',
            'instruction' : 'simon gp[g[says',
            'body' : 'lorem dipsem ikhsduifohsdihfsjkahfksdl56u456fklasdfhsklasdhjkfgaklf'
        }],
        'block' : [{
            'title' : 'Title2-2',
            'instruction' : 'sihehamon stop says',
            'body' : 'lorem dipsem ikhsduifohsdihfsjkahfksdlfkla-0-90-sdfhsklasdhjkfgaklf'
        }]
    }]
}],
'page' : [{
    'article' : [{
        'block' : [{
            'title' : 'Title2-1-1',
            'instruction' : 'simon says',
            'body' : 'lorem dipsem ikhsduifohsdihfsjkahfksdlfklasdfh-0===-=-sklasdhjkfgaklf'
        }],
        'block' : [{
            'title' : 'Title2-1-2',
            'instruction' : 'simon stop says',
            'body' : 'lorem dipsem ikhsduifohsdihfsj58779kahfksdlfklasdfhsklasdhjkfgaklf'
        }]
    }],
    'article' : [{
        'block' : [{
            'title' : 'Title2-2-1',
            'instruction' : 'simon gp[g[says',
            'body' : 'lorem dipsem ikhsduifohsdihfsjkahfksdl56u456fklasdfhsklasdhjkfgaklf'
        }],
        'block' : [{
            'title' : 'Title2-2-2',
            'instruction' : 'sihehamon stop says',
            'body' : 'lorem dipsem ikhsduifohsdihfsjkahfksdlfkla-0-90-sdfhsklasdhjkfgaklf'
        }]
    }]
}]
}

And the jquery to extract it..

$(document).ready(function(){

    $.getJSON('data.json', function(json){  
        alert(json.page[0].article[1].block[0].title)
    })

})
  • 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-06-13T12:35:24+00:00Added an answer on June 13, 2026 at 12:35 pm

    Use double-quotes instead of single quotes. Single quotes might work with eval() or jQuery, but they’re not standard.

    Also, in JSON, each object’s keys must be unique, so your article object cannot have two block entries, for example. You could rewrite your data like this:

    {
    "pages": [{
        "articles": [{
            "blocks": [{
                "title": ...
            }, ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Been using XML for ages now for data storage & transfer, but have never
I have been thinking about the optimal way to create an XML file using
We have been using EHCache with CF8 for a while now with no issues.
I have been using this code to parse xml till now. Its was working
I have been trying to create an XML using the simplexml library (v2.6.2) http://simple.sourceforge.net/home.php
I have been developing web apps for a while now and for the past
I have been using fop 0.95 to generate pdf files from xml data. I
Many of us have been indoctrinated in using XML for storing data. It's benefits
i've been scrounging the internet for a while now and have been unable to
Hi StackOverflow friends. Running Drupal 6.22 php 5.3 I have been looking around now

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.