August 16th, 2013, 04:38 AM
Combining Ajax call with standard php?
I'm using jQuery ajax to fetch results "as-you-type" in a textfield.
But in the first place when the user visits the page, all the data should be there.. without the user having to type some letters first..
Do i do this with a normal php call at the top of the page?
Or do i also use .ajax to load all the data when the page loads.
Not quite sure how to combine the two.
August 16th, 2013, 04:56 AM
search for jquery autocomplete. Depending on where/how the values come from, you can query a page to get "appropriate" result or load up all the available options on page load
August 16th, 2013, 05:13 AM
you can do both.
On the other hand, when you do everything with Ajax, you don't need redundant code.
So it's a matter of preferences.