Giter Site home page Giter Site logo

Comments (1)

agarzola avatar agarzola commented on August 20, 2024

Hello, Alexandra!

I answered your question on SO, but will repeat it here for the sake of other people who may encounter the same issue and come here before SO.

In the case of using a url for the data, the script sends the request as whatever you set in the specified url, and adds q=[current input value] at the end. In the case of initial load when you type in “a”, this is sent to your backend script: localhost/boo/?get_suggestions=1&q=a. Thus, autocompelte.js expects this initial query to produce only items that match the query. After that initial request, the script will take on the filtering subsets internally, to decrease server load. This explains why “ac” returns only items that match your criteria. This is the autocomplete script doing its job of filtering what the server gave it.

If I’m interpreting your backend code correctly, it makes no use whatsoever of the q parameter being sent in the request, so your code is returning every possible term. Autocomplete presumes this is the result of a proper search and shows you all of it, waiting for more characters to be typed in for it to filter the list further.

The point being that you need to make your backend script filter the list of terms to whatever matches the q parameter before returning it to the autocomplete script.

Let me know if I can be of further assistance!

from jqueryautocompleteplugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.