How can I show suggestions in a list one by one?
When I run the below codes, I get this as my suggestion when I type in google
: ["Google", "Gmail", "Google Maps"]
.
I want the suggestions to be shown in this way:
Google
Gmail
Google Maps
How can I do this?
If possible, please explain my mistakes.
Thanks in advance
You are returning
json
formatted objects insuggestion.php
but using it asHTML
inscript_suggestion.php
.Either update
suggestion.php
to return a HTML snippet or have the javascript inscript_suggestion.php
decode the json and use that to build the suggestions.Example HTML output: