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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:30:59+00:00 2026-06-07T00:30:59+00:00

I have the following code which definitely returns a proper data result if I

  • 0

I have the following code which definitely returns a proper data result if I use the 2.0.0 version, but for some reason bootstrap’s typeahead plugin is giving me an error. I pasted it below the code sample:

<input id="test" type="text" />

$('#test').typeahead({
    source: function(typeahead, query) {
        return $.post('/Profile/searchFor', { query: query }, function(data) {                
            return typeahead.process(data);
        });
    }
});

When I run this example I’m getting a jQuery bug that says the following:

**
item is undefined
matcher(item=undefined)bootst...head.js (line 104)
<br/>(?)(item=undefined)bootst...head.js (line 91)
<br/>f(a=function(), b=function(), c=false)jquery....min.js (line 2)
<br/>lookup(event=undefined)bootst...head.js (line 90)
<br/>keyup(e=Object { originalEvent=Event keyup, type="keyup", timeStamp=145718131, more...})bootst...head.js (line 198)
<br/>f()jquery....min.js (line 2)
<br/>add(c=Object { originalEvent=Event keyup, type="keyup", timeStamp=145718131, <br/>more...})jquery....min.js (line 3)
<br/>add(a=keyup charCode=0, keyCode=70)jquery....min.js (line 3)
<br/>[Break On This Error]  
<br/>return item.toLowerCase().indexOf(this.query.toLowerCase())**

Any thoughts? … The same code works in the 2.0.0 version of the plugin, but fails to write to my knockout object model.

THIS IS WORKING TYPEAHEAD CODE FOR the 2.0.0 version:

var searchFunction = function(typeahead, query) {
        $.ajax({
            url: "/Profile/searchFor?tableName=" + tableName + "&query=" + query + "&extendedData=" + $("#" + extendedData).val(),
            success: function(data) {
                if (data.errorText != null) {
                    toggleLoading("false");
                    showDialog(data.errorText, "Error");
                    return;
                }                
                var result = data.results.split("::");
                typeahead.process(result);
            },
            select: function(event, ui) {
            }
        });
    }

    $("#" + inputBoxId).typeahead({
        source: searchFunction,
        onselect: function(obj) {
        }
    });
  • 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-07T00:31:02+00:00Added an answer on June 7, 2026 at 12:31 am

    1) Bootstrap typeahead v2.0.2 solution

    have a look at this pull request, it looks like what you’re looking for (its a fork from bootstrap typeahead v2.0.2).

    I use it myself and it’s working 🙂

    2) Bootstrap typeahead v.2.1.0-work in progress solution

    Also you can try this solution. I just changed my project to use this one, becouse it’s gonna be supported in future versions and it looks cleaner 🙂

    In my case:

    $("#typeahead").typeahead({
      source: function(query, process) {
        $.post('url_path', { q: query, limit: 4 }, function(data) {
          process(data);
        }); // end of post
      }
    });
    

    Where script url_path requiers 2 arguments q (string) and limit (results limit) and returns json response (array):

    Example response to query i with limit 4:

    [“Eminem”,”Limp Bizkit”,”Rihanna”,”Will Smith”]

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

Sidebar

Related Questions

I have following code which works for radio buttons but need to be changed
i have the following code which switches some fullscreen-background-images (fadeOut, fadeIn). setInterval(function() { var
I have following code which works fine in iPhone application but in iPad I
i have following code in which, i am fetching the data from the sqlite
I'm trying to use opengl in C#. I have following code which fails with
I want to know is below code correct ? I have following code which
I have the following code which is working, I was wondering if this can
I have the following code which is used to upload large files (~6MB) to
I have the following code which is fine if I give invalid parameters (though,
I have the following code which will generate two pdf files containing plots to

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.