how to make multiple ajax requests in cakephp
I want t开发者_高级运维o make a new ajax request automatically while one ajax request is being processed (in cakephp), how can i be able to do that? I know that user can initiate multiple ajax request simultaneously, but how can i initiate a new ajax request automatically when another ajax request is made?
Below is the way, am calling one ajax function inside another, but its not working,
echo $ajax->form(array('type' => 'post', 'options' => array('model' => 'Thing',
'url' => array('controller' => 'things', 'action' => 'xyz'),'update' => 'dy4', 'indicator' => 'ldng', 'loading' => ( $ajax->
remoteFucntion(array('url' => array('controller' => 'stories', 'action' =>
'keep'), 'update' => 'dy3', 'frequency' => 5))))));echo $form->input('a', array('type' => 'checkbox'));echo $form->input('b', array('type' => 'checkbox')); echo $form->end('RUN');
Go to CakePHP coockbook and look at callback options. Choose 'before', 'loading', 'complete' or whatever suits you. You'll probably have to write ajax in javascript for those parameters.
Just chain the javascript calls.
精彩评论