JavaScript autocomplete without external library

后端 未结 6 2080
面向向阳花
面向向阳花 2020-12-23 11:33

Is there a javascript autocomplete library that does not depend on any other libraries?

I am not using jQuery or the likes as I am making a mobile app that I need to

6条回答
  •  轮回少年
    2020-12-23 12:07

    The core of an autocomplete script will be the ajax call to the dictionary of terms.

    I assume your mobile application already includes an ajax function, so maybe you're better off just writing your autocomplete from scratch? Basically all you need in an input tag, a keyup event handler that triggers the ajax call, and a div to collect the response.

    [Update] Based on the comments, some references from John Resig's blog:

    http://ejohn.org/blog/revised-javascript-dictionary-search/

    http://ejohn.org/blog/jquery-livesearch/

提交回复
热议问题