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

  • Home
  • SEARCH
  • 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 4239930
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T03:05:58+00:00 2026-05-21T03:05:58+00:00

my explorations into jquery are proving a little frustrating. I am receiving the following

  • 0

my explorations into jquery are proving a little frustrating.

I am receiving the following Json back from the server.

{"status":"ok",
"0":{"ID":"1","location":"location info"},
"1":{"ID":"2","location":"location info"},
"2":{"ID":"3","location":"location info"},
...etc
});

I need to put all the objects except the status into an array.
I achieved this in AS3 as follows, but don’t seem to be able to get any where near using jquery.

public function ResultToArray(jsonString:String):Array
{
var jObj:Object = JSON.decode(jsonString);
var objects:Array = [];
for each(var obj:Object in jObj)
{
    if(obj is String)break;
    objects.push(obj);
}
return objects;
}

I would like to put each of the objects in an array.

The following only loops over one object.

      $(data).each(function(index)
    {
    alert(data[index]["location"])  
    });

Please pardon my ignorance.
If I could receive any advice It’d be much appreciated.

  • 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-21T03:05:58+00:00Added an answer on May 21, 2026 at 3:05 am
    var o = jQuery.parseJSON(jsonString),
            myObjects = [];
    for (var c in o) {
        if (c != 'status')
            myObjects.push(o[c]);
    }
    

    Possibly you could check (typeof o[c] == 'object') if you don’t want to check for ‘status’.

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

Sidebar

Related Questions

One of the biggest issues currently holding me back from diving full steam into
I'm building a historical record of development into git from saved zip files. I'm
I've integrated jQuery Uploadify into my WordPress plugin for multiple file uploads. The Flash
So I'm using this pretty standard jquery plugin pattern whereby you can grab an
This may be closed, a couple of minutes from now, but I think I
I've taken a look into OpenJDK source code of CopyOnWriteArrayList and it seems that
I found some example code of how to implement a textfield into a cell
I've been trying to figure out what computer field I want to go into
I’m not sure how to use Java/JDBC to insert a very long string into
For anyone interested, I ended up building a localstorage with expirations script here, http://plugins.jquery.com/project/localcache

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.