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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:28:09+00:00 2026-05-30T19:28:09+00:00

Nothing is currently broken. :) I’m just looking to gain some performance. I have

  • 0

Nothing is currently broken. 🙂 I’m just looking to gain some performance.

I have a form with chained select (one drop down changes, and the second drop down value changes). Right now, my form will perform an ajax call to another page and retrieve the contents as json data string. This is fast but if the data was already retrieved (e.g. stored in memory), the changes would be instantaneous instead of the slight delay. Can I change the call this function to something that runs within the page? For example, jQuery Autocomplete does this (look at the source code). Right now, when you change the value for the operating system, the list of models will change. If i loaded the modele in memory, I’d need to model the json string to include which options corresponded to the operating systems.

To put it in other words, can I create the json string and store it in memory and then just reference this data instead of making a separate ajax call?

function updateModels(i){
    var pltfrm = $(i).val();
    var firstOption = $(i);
    var model = firstOption.parent().next().find('.model');
    $.getJSON("index.cfm?do=misc.getModels&platform=" + pltfrm,
    function(j){
        var options = '';
        for (var i = 0; i < j.length; i++) 
        {
            options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>';
        }
    model.html(options);
    });
}

My json data is curently formatted for the LINUX OS:

[
{"optionValue":"","optionDisplay":"Select a model"},
{"optionValue":"Dell 2850","optionDisplay":"Dell 2850"},
{"optionValue":"Dell 2950","optionDisplay":"Dell 2950"},
{"optionValue":"Dell 2970", "optionDisplay":"Dell 2970"},
{"optionValue":"Dell 6850", "optionDisplay":"Dell 6850"},
{"optionValue":"Dell R710", "optionDisplay":"Dell R710"}
]

This is very low priority but I know it would help performance so if you have time and are willing to work with me, I’d sure appreciate it.

  • 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-30T19:28:10+00:00Added an answer on May 30, 2026 at 7:28 pm

    Sure, just save the data in the localStorage:

    function updateModels(i){
        var pltfrm = $(i).val();
        var firstOption = $(i);
        var model = firstOption.parent().next().find('.model');
    
        var storedItemSerialized = localStorage.getItem('model' + pltfrm), storedItem = {};
    
        var redrawModels = function (j)
        {
            var options = '';
            for (var i = 0; i < j.length; i++) 
            {
                options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>';
            }
            model.html(options);
    
        }
    
    
        if (storedItemSerialized)
        {
           redrawModels($.parseJSON(storedItemSerialized));
        }
        else
        {
    
          $.getJSON("index.cfm?do=misc.getModels&platform=" + pltfrm,
          function(j){
            localStorage.setItem('model' + pltfrm, JSON.stringify(j));
            redrawModels(j);
          });
    
        }
    }
    

    This method has the added benefit of saving the data through page requests.

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

Sidebar

Related Questions

I'm currently implementing a RESTful API (nothing serious, just for a blog engine i'm
I'm currently designing a program that will involve some physics (nothing too fancy, a
I'm currently looking at a hefty Rails test suite. It's nothing I can get
I currently have a form with a disabled submit input. In firefox 4.0, if
The troubleshooting page has some advice about GET, but nothing for POST. Currently I
I'm currently using an .htaccess to get round a problem with a CMS, nothing
I often have nothing more than an FTP access to a server on which
I believe there is nothing currently available in MySQL that allows access to the
On a new WordPress 2.8 installation, I have some posts assigned to category Foo
I am currently writing a website in nothing more than HTML and CSS for

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.