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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T23:21:02+00:00 2026-05-19T23:21:02+00:00

I am using jQuery Autocomplete with JSON but the resulting data is not displaying

  • 0

I am using jQuery Autocomplete with JSON but the resulting data is not displaying correctly. If you go to http://whatsmybeer.com and type in “firestone” you get a drop down list that reads “Undefined” with the correct number of results but the JSON is not displaying correctly. You can see an example of the the JSON output which is called from the javascript http://whatsmybeer.com/search.inc.php?beer=firestone&callback=?

My JS script to display the JSON results.

<script>
    $(document).ready(function() {
        $( "#REMOTE" ).autocomplete({
            source: function( request, response ) {
                url = "search.inc.php?beer=" + request.term;
                $.getJSON(url + '&callback=?', function(data) {
                    response(data);
                });
            }
        });
    });
</script>

What am I doing wrong with the parsing?

  • 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-19T23:21:03+00:00Added an answer on May 19, 2026 at 11:21 pm

    First of all I’d limit the search result to 10 or whatever – first response with thousends or whatever number of beers you have kills the browser when it tries to process the data for display.

    Further I’d set the minLength option of autocomplete to 2 as putting one letter is overkill for server side as if someone will enter ‘a’ it will probably return half of the database (if you won’t like to include the returned amount limit) adding autocomplete after entering 2nd letter is more natural especially with large databases.

    And most importantly – you need to have your JSON response formatted in the right way.

    you return object with:

    { 
        beer_name: "name" 
    }
    

    and you should return:

    {
        label: "autocomplete display value",
        value: "input value after selection"
    }
    

    if label and value are the same it should be enough to provide just the label and you should be able to safely omit duplicating it in value

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

Sidebar

Related Questions

I am using this jquery ui autocomplete but i need to grab the data
i'm using jquery to invoke JSON-requests and they're triggered form a bunch of autocomplete-fields.
I'm using Jquery Autocomplete based on: http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ . I am able to select a
The following autocomplete code works with Jquery 1.4.4 but not with 1.5.1. I am
I'm using the jQuery autocomplete plugin to get a list of locations, which works
Has anyone used jQuery to populate an autocomplete list on a textbox using ASP.NET
I'm having an issue using jQuery autocomplete with dynamically created inputs (again created with
I followed the directions in this post: how can we integrate jquery autocomplete using
I am using the jQuery autocomplete plugin and have wired up an input field
I'm using the JQuery autocomplete plug in, and am passing in an array of

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.