Ajax Server Side and Client Side confusion clarification needed
Let's imagine an autocomplete widget scenario that grabs it's data from a database.
Let's assume that we have to:
Grab the contents from DB1 to be displayed once the user clicks the input field. Then, After the user makes it's choice, we need to:
Query the database DB1 for additional data concerning that selection made by the user.
Using that data to query another system WEBSERVICE1 and retrieve a response with more data.
Finally, display that returned data int开发者_运维技巧o input boxes so that we can work with them.
I'm describing this, so that you can realize that it's not a question of having one server side function, but several that are connected with other files etc... If this counts anything.
My try to describe the process:
Description A)
We need to, at some javascript event, call a php script. Process some stuff, and return back the results to be displayed.
I'm under a mvc "sort of" pattern but my controller isn't able to decide which views will be displayed. Instead, is the view that calls the controller method that she needs. Knowing this:
Can anyone, be kind enough to draw a skeleton or fill the blanks (that are A LOT I realize that and I'm sorry) on Description A above?
:s
Lost, Márcio
I'm not sure exactly what you are looking for, but have to tried using a jqueryUI autocomplete box?
http://jqueryui.com/demos/autocomplete/
精彩评论