I have an web application (PHP backend) where for a single user action (say onclick) I want to initiate multiple requests to the same server (to different php functions/files) and asynchronously update the response on the page (the call back function is same for all the requests).
(each task is intensive so want to do it asynchronously and update )
What is the best solution for this ? Is it better to
a) call different server calls from the java script file? if so do we create multiple http objects ? can someone point me to the few examples on how to do this?
or
b) call one Php service and have the php fork the different requests on the server side. I am not sure if this can be done i.e., multiple requests be initiated asynchronously on the server side in php ? and if so how to dynamically update the resultant page as each request finishes?
Any insight into other options for this scenario is also highly appreciated.
thanks
Dave.