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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:35:34+00:00 2026-06-03T05:35:34+00:00

I just get a strange bug when using those two tools. I’m making an

  • 0

I just get a strange bug when using those two tools.
I’m making an AJAX query to an API, then retrieving JSON data which is stored within localStorage and displayed into an autocomplete panel. The problem is that according to the origin of the autocomplete source, the panel will react differently.

Here is the callback function called on AJAX success :

function _company_names(data)
{
    localStorage.setItem('ac_source', JSON.parse(data).Result);

    // Works fine
    $("#search_input").autocomplete( "option", "source", JSON.parse(data).Result);
    // Send an AJAX request
    $("#search_input").autocomplete( "option", "source", localStorage.getItem('ac_source'));
}

If i pass JSON.parse(data).Result as result to the autocomplete source, it will be fine. However if I pass localStorage.getItem(‘ac_source’), the ac widget will send an AJAX request (not using my own function) blowing in the wind (my node.js will try to parse it, etc.).

I’m using localstorage to access these data from an other part of my code (store it to compare with other user research and displaying it if the request is the same).

  • 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-06-03T05:35:35+00:00Added an answer on June 3, 2026 at 5:35 am

    You can store only string data in Local Storage:

    localStorage.setItem('ac_source', '{"key":"data","key1":"data1"}');
    
    $("#search_input").autocomplete( "option", "source", JSON.parse(localStorage.getItem('ac_source')).Result);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When using wx.TextCtl with the wx.TE_RICH2 option in windows, I get this strange bug
I just get started using BDD in Rails application, but I'm not sure what
I'm using colorbox , i just get undefined as my get values? $('.banner').colorbox({ opacity:
I'm facing a strange bug. Page.ResolveUrl(~/myPage.aspx?param=valueA:valueZ); And it just not work, visibly cause of
I am making some code , But it is so strange that code just
I have a strange bug where I am doing an ajax load from an
I've got this strange bug in my app. I'm making a subview and drawing
I'm experiencing a very strange problem with Rails and ajax using jQuery (although I
I just prepare small update for my android app, but I get this strange
I have a strange bug with Grails. I want to get back some persisted

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.