jQuery Autocomplete with Remote JSON Source + Google App Engine + Python

前端 未结 2 398
逝去的感伤
逝去的感伤 2021-01-28 10:55

So let\'s say I have a webapp which just lets users save their hobbies. So I have Kind like this:

class Hobby(ndb.Model):
    hobby_name = ndb.StringProperty()
<         


        
2条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-28 11:28

    search.php needs to be replaced with something like suggetsHobbies.php That file should return a list of hobbies that the auto-completion tool can use to build the list of hobbies that are suggested. It is given a parameter term that contains what the user has typed so far. Use that to restrict the list returned. F.ex. if term is "ba", return a list of hobbies beginning with "ba".

提交回复
热议问题