Get mysql result in javascript global array for further searching through
list
I need to have a MySQL table result in JS array so that i can search
through the names when typed in a text box. I mean, lets say i have a
table with some names, now when the page is requested, it should populate
a div with the list of the names from MYSQL, the div needs to have an
input box in which when initials are typed, the list below should find the
names matching the keywords kind of like search.
For this, i think i need to store the mysql result in a JS array so that
on the onkeyup and onkeypress event of the text box, it should search for
the matching results from the array items and populate the list with only
those items.
I know, i'll have to make an ajax request on document.ready to fetch the
results from database but then have no idea, how to store it in an array
and then search through that on the text box events.
No comments:
Post a Comment