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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:55:22+00:00 2026-06-17T17:55:22+00:00

I am needing to grab some JSON from a site and parse it. The

  • 0

I am needing to grab some JSON from a site and parse it. The problem is that the objects are named “-1” “-2” and so forth.

When I try to parse it, Firebug comes back with, “TypeError: obj is undefined
length = obj.length”

Chrome comes back with a similar message, “Uncaught TypeError: Cannot read property ‘length’ of undefined”

For reference, here’s a snipet of the JSON:

{
  "-1": {
     "number": 47,
     "properties": [
       [

And here’s the code I’m trying to use.

$.getJSON("http://www.website.com/builds?select=-1&select=-10",function(data){
  $.each(data.-1, function(info,value){

If I download the JSON, save it locally and rename “-1” to “one”, rename “-2” to “two”, then it works fine. E.G. the JSON becomes:

{
  "one": {
     "number": 47,
     "properties": [
       [

And my code becomes

$.getJSON("C:\json.json",function(data){
    $.each(data.one, function(info,value){

This works fine, but it adds another complicated step.

Is there a way to parse on the original JSON (as it is generated automatically from a server, and changes often), or am I stuck with trying to figure out how to save it locally and change the object names before parsing?

  • 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-17T17:55:23+00:00Added an answer on June 17, 2026 at 5:55 pm

    data.-1 must be referenced as a string using bracket notation.

    data["-1"]

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I often find myself needing reference to an object that is several objects away,
I'm needing to grab a specific element. I have an event that triggers when
Needing some guidance about how to properly graph data that is very small and
I am trying to parse a local JSON file that has been stored in
needing some help. I have two divs that I need to fill with images.
Often I find myself needing to write scripts that have to execute some portions
needing some help to just break down the problem. I have new users who
Needing a random number generator that returns a sample from a normal (Gaussian) distribution,
I'm just needing a simple bit of code for vb.net that will allow me
I am needing to transfer some logs which were timestamped in ticks to an

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.