jquery - How to search for name from local storage using typeahead? -
var a=[{ "name":"harsha", "age":"18" }, { "name":"havisha", "age":"19" } ]; localstorage.setitem("list",json.stringify(a)); $("#namm").autocomplete({ source:[ b=localstorage.getitem("list") ] });
i have stored names in local storage name.then when search name in textbox names must searched localstorage.how can possible .i have tried above>but not able it
if list
string array try this:
var list = localstorage.getitem("list"); $("#namm").autocomplete({ source: list });
p.s. check variable returned localstorage not null.
Comments
Post a Comment