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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:13:15+00:00 2026-05-28T13:13:15+00:00

Ive got a JSON string coming over and being assinged to a javascript object

  • 0

Ive got a JSON string coming over and being assinged to a javascript object

{
   "results":[
      {
        "id":"460",
        "name":"Widget 1",
        "loc":"Shed"
      },{
        "id":"461",
        "name":"Widget 2",
        "loc":"Kitchen"
      }]
}

Is there a way to “query” this data in javascript so I could search for an ID of 460 and get name and loc returned (other than just looping through the whole object)? I’ve got jQuery and Prototypejs available to use.

  • 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-28T13:13:16+00:00Added an answer on May 28, 2026 at 1:13 pm

    DEMO

    JavaScript arrays have a built-in filter method:

    var valuesWith460 = obj.results.filter(function(val) {
        return val.id === "460";
    });
    

    (to support older browsers you’ll want to grab the shim from the link above)

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

Sidebar

Related Questions

I've got the JSON coming back like this: { responseData: [{ responseData: { translatedText:
ive got an object that looks like this with print_r(): SimpleDOM Object ( [0]
I've got the following JSON string to deserialize: [{application_id:1,application_package:abc},{application_id:2,application_package:xyz}] I'm using DataContractJsonSerializer method. It
I've got following classes: public class Container { private String name; private Data data;
i've got a problem with C# regular expression. There is an JSON string like
I've got the following object: $json = '{response: {status: {message: Success}, images: [{url: http://domain.com/images/0001.jpg},
OK i've got my json string built but i'm not sure what to do
I've got a JSON string that I want to convert to a Map structure
I've got an object which was deserialized from JSON. It looks like this, introspected
I've got a simple ASP.NET webservice. I'm wanting to return a string of json

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.