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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:36:51+00:00 2026-05-25T19:36:51+00:00

Basically, I’m working on a page that includes four different JSON thingies (objetcs,arrays). Forgive

  • 0

Basically, I’m working on a page that includes four different JSON “thingies” (objetcs,arrays). Forgive my lack of proper terminology.

When I get the JSON, it comes in as an object with a bunch of sub-objects, and each “sub-object” looks like this:

"token":"government",
"title":"Government",
"isSelected":false,
"type":"CATEGORY",
"subtype":"INDUSTRY",
"count":12

So the first task is to loop through each JSON and populate a box full of checkboxes, using the title as the label and the isSelected to indicate the checked status. So far, so good.

BTW, somewhere aslong the way, I picked up a JS script that checks whether an object is JSON or an array, and according to that “quick & dirty” test, my object is an array. Or an array object (you know, the one is created with [ ] and the other with { })?

Anyway, when the end user checks and un-checks checkboxes, I need to keep track of it all and immediately send back changes to the server (when the user clicks a DONE button). The crazy thing is that by looping through the objects, I was able to change the isSelected value to true . . . just not back to false.

for(var i = 0; i < $array.length; i++){
    $array[z].isSelected = true;
}

Perhaps I was up too late when I worked on all of this, but using the same approach, I could not change $array[z].isSelected to false when the checkbox got de-selected.

In the end, I converted the JSON “thingy” to a string, search and replaced the corresponding values, and then converted the string back into an object. This is all working now, but I feel as though I’ve just used up a roll of duct tape on something that could have been put together by snapping the pieces together nicely.

Question: Did I miss the boat totally and is there a simple way to change values of JSON objects?

If so, could you point me in the right direction?

  • 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-25T19:36:52+00:00Added an answer on May 25, 2026 at 7:36 pm

    That JSON thingy is just a string representation of a javascript object.

    One way of creating an object is

    var myObject = {
        "myName": "AName",
        "myType": "AType"
    };
    

    This object can be referenced as myObject, with the properties myObject.myName and myObject.myType containing values AName and AType.

    You should be able to just reference the object by name as objName.token objName.title etc.

    If you have trouble try parsing the json with javascript then reference the result as above. This should make it easier for you to access, manipulate or delete data in the objects properties as well.

    The nesting of these as below can be referenced as myObject.moreProperties.prop1 etc

    var myObject = {
        "myName": "AName",
        "myType": "AType",
        "moreProperties": {
            "prop1": "vaue1",
            "prop2": "vaue2",
        }
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, I have a main page (parent page) with a link that opens up
Basically I have an IFRAME that contains a given page - I want to
Basically, I would like a page that consist of a slideshow that contains a
Basically I am trying to restart a service from a php web page. Here
Basically I’ve heard that certain conditions will cause .NET to blow past the finally
Basically I'm trying to accomplish the same thing that mailto:bgates@microsoft.com does in Internet Explorer
Basically, what I'm trying to create is a page of div tags, each has
Basically from a database I am getting data that is formatted like this nameofproject101
Basically I have an iframe loaded that is accessed from the parent whenever it
Basically I wrote a script that generates a xml file based on user input.

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.