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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:59:44+00:00 2026-05-15T20:59:44+00:00

I have some JSON objects I’d like to store in a map for the

  • 0

I have some JSON objects I’d like to store in a map for the lifetime of my app. For example, my app shows a listing of Farms. When a user clicks one of the Farm links, I download a Farm representation as JSON:

Farm 1
Farm 2
...
Farm N

every time the user clicks one of those links, I download the entire Farm object. Instead, I’d like to somehow make a global map of Farms, keyed by their ID. Then when the user clicks one of the above links, I can see if it’s already in my map cache and just skip going to the server.

Is there some general map type like this that I could use in jquery?

Thanks

  • 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-15T20:59:45+00:00Added an answer on May 15, 2026 at 8:59 pm

    What about a JavaScript object?

    var map = {};
    
    map["ID1"] = Farm1;
    map["ID2"] = Farm2;
    ...
    

    Basically you only have two data structure in JavaScript: Arrays and objects.

    And fortunately objects are so powerful, that you can use them as maps / dictionaries / hash table / associative arrays / however you want to call it.

    You can easily test if an ID is already contained by:

    if(map["ID3"]) // which will return undefined and hence evaluate to false
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some simple .NET objects I'd like to serialize to JSON and back
I have some objects deserialized from JSON to which I'd like to assign a
I have looked at GSON to parse some of my JSON objects. However, this
I am trying to output some Java objects as JSON, they have List properties
Inside my .aspx I have some JSON code that looks like this: function someFunctionName()
Suppose you have some complex JSON like: {A : valA, B : { C
I have some JSON with Two objects and these each have 3 objects nested.
i have some Objects serialized with the System.Runtime.Serialization.Json.DataContractJsonSerializer and written to my Database: Dim
i have some json objects and some of them have some other objects inside
Let's say you have some nested json objects. And you want to retrieve some

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.